Missed a spot

This commit is contained in:
Your Name 2018-11-06 15:52:08 +00:00
parent 9bc1fdea39
commit 8297f7bea8
1 changed files with 2 additions and 2 deletions

View File

@ -623,7 +623,7 @@ func localRedirect(w http.ResponseWriter, r *http.Request, newPath string) {
// ends in "/index.html" to the same path, without the final
// "index.html". To avoid such redirects either modify the path or
// use ServeContent.
func ServeFile(w http.ResponseWriter, r *http.Request, name string) {
func ServeFile(w http.ResponseWriter, r *http.Request, name string, index bool) {
if containsDotDot(r.URL.Path) {
// Too many programs use r.URL.Path to construct the argument to
// serveFile. Reject the request under the assumption that happened
@ -634,7 +634,7 @@ func ServeFile(w http.ResponseWriter, r *http.Request, name string) {
return
}
dir, file := filepath.Split(name)
serveFile(w, r, http.Dir(dir), file, false)
serveFile(w, r, http.Dir(dir), file, false, index)
}
func containsDotDot(v string) bool {