aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2011-08-04 08:20:53 -0400
committerRuss Cox <rsc@golang.org>2011-08-04 08:20:53 -0400
commit62d4b8ebd2c00e3c3d54d05dc7fe56d829b5aa01 (patch)
tree17fecd91aa719a21d22ac9541393f230645792be
parent4143491c4ad17021b062c9fbabdc2d9d6aed11ef (diff)
downloadgo-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.go2
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()