From: Yasuhiro Matsumoto Date: Thu, 4 Aug 2011 12:20:53 +0000 (-0400) Subject: http: correct path to serve index.html. X-Git-Tag: weekly.2011-08-10~32 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=62d4b8ebd2c00e3c3d54d05dc7fe56d829b5aa01;p=gostls13.git http: correct path to serve index.html. calling filepath.FromSlash(x) make invalid character to serve file. Fixes #2128 R=golang-dev, alex.brainman, rsc CC=golang-dev https://golang.org/cl/4810064 --- diff --git a/src/pkg/http/fs.go b/src/pkg/http/fs.go index 26d9311370..2c7c636fda 100644 --- a/src/pkg/http/fs.go +++ b/src/pkg/http/fs.go @@ -149,7 +149,7 @@ func serveFile(w ResponseWriter, r *Request, fs FileSystem, name string, redirec // use contents of index.html for directory, if present if d.IsDirectory() { - index := name + filepath.FromSlash(indexPage) + index := name + indexPage ff, err := fs.Open(index) if err == nil { defer ff.Close()