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
This commit is contained in:
Yasuhiro Matsumoto 2011-08-04 08:20:53 -04:00 committed by Russ Cox
parent 4143491c4a
commit 62d4b8ebd2

View 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()