mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-26 02:09:47 +08:00
Use filepath.Clean for fileserver.
This commit is contained in:
parent
741d7685f1
commit
f3a183ecc1
|
@ -4,6 +4,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ func (fh *fileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, e
|
||||||
upath = "/" + upath
|
upath = "/" + upath
|
||||||
r.URL.Path = upath
|
r.URL.Path = upath
|
||||||
}
|
}
|
||||||
return fh.serveFile(w, r, path.Clean(upath))
|
return fh.serveFile(w, r, filepath.Clean(upath))
|
||||||
}
|
}
|
||||||
|
|
||||||
// serveFile writes the specified file to the HTTP response.
|
// serveFile writes the specified file to the HTTP response.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user