]> Cypherpunks.ru repositories - gostls13.git/commit
net/http: prepend ./ to directory list hrefs in FileServer
authorSalman Aljammaz <s@0x65.net>
Sun, 21 Aug 2016 15:59:56 +0000 (16:59 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sun, 21 Aug 2016 18:14:05 +0000 (18:14 +0000)
commite2b30e900064373bce2f4ba4d3917df3de99ac69
tree7133972e299732e30e27a44d2b9c9c5c93fbd524
parent6a393dc64fb06ba17f737432a45c63233aa4bd3d
net/http: prepend ./ to directory list hrefs in FileServer

Certain browsers (Chrome 53, Safari 9.1.2, Firefox 46) won't correctly
follow a directory listing's links if the file name begins with a run
of characters then a colon, e.g. "foo:bar". Probably mistaking it for
a URI. However, they are happy to follow "./foo:bar", so this change
prepends "./" to all link hrefs in the directory listing of
FileServer.

Change-Id: I60ee8e1ebac73cbd3a3ac0f23e80fdf52e3dc352
Reviewed-on: https://go-review.googlesource.com/27440
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/fs.go
src/net/http/fs_test.go