diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2011-08-04 08:20:53 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2011-08-04 08:20:53 -0400 |
commit | 62d4b8ebd2c00e3c3d54d05dc7fe56d829b5aa01 (patch) | |
tree | 17fecd91aa719a21d22ac9541393f230645792be | |
parent | 4143491c4ad17021b062c9fbabdc2d9d6aed11ef (diff) | |
download | go-62d4b8ebd2c00e3c3d54d05dc7fe56d829b5aa01.tar.gz go-62d4b8ebd2c00e3c3d54d05dc7fe56d829b5aa01.zip |
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
-rw-r--r-- | src/pkg/http/fs.go | 2 |
1 files changed, 1 insertions, 1 deletions
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() |