Don't submit directories to MIME type checks or any other checks which depend upon them.
This commit is contained in:
parent
c2f90b0006
commit
b37ce48228
|
@ -71,6 +71,12 @@ func GetHandler(config Config) http.HandlerFunc {
|
|||
http.Error(w, "File not world-readable.", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
// If this is a directory, nothing below makes sense, so just
|
||||
// serve it!
|
||||
if info.IsDir() {
|
||||
http.ServeFile(w, r, path)
|
||||
return
|
||||
}
|
||||
|
||||
// Get MIME type
|
||||
ext := filepath.Ext(path)
|
||||
|
|
Loading…
Reference in New Issue