diff --git a/enhanced-file-server.go b/enhanced-file-server.go index 5f89aa9..39b13b2 100644 --- a/enhanced-file-server.go +++ b/enhanced-file-server.go @@ -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 {