]> Cypherpunks repositories - gostls13.git/commitdiff
http: correct path to serve index.html.
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Thu, 4 Aug 2011 12:20:53 +0000 (08:20 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 4 Aug 2011 12:20:53 +0000 (08:20 -0400)
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

src/pkg/http/fs.go

index 26d9311370d9c467081d47051457af4baecdb8b6..2c7c636fda0b24fdbf3e89b4b7c88c23dc02d086 100644 (file)
@@ -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()