Reject requests containing '..' in them
This commit is contained in:
parent
ceb40a2fab
commit
a1a2523c5c
21
server.go
21
server.go
@ -264,6 +264,7 @@ type ServeDir struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FileServer takes a filesystem and returns a handler which uses that filesystem.
|
// FileServer takes a filesystem and returns a handler which uses that filesystem.
|
||||||
|
// The returned Handler rejects requests containing '..' in them.
|
||||||
func FileServer(fsys FS) Handler {
|
func FileServer(fsys FS) Handler {
|
||||||
return fsHandler{
|
return fsHandler{
|
||||||
fsys,
|
fsys,
|
||||||