Missed a spot
This commit is contained in:
		| @@ -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 { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user