Return after serving an error when MIME type detection fails.
This commit is contained in:
parent
b37ce48228
commit
aad4ebba8f
|
@ -83,6 +83,7 @@ func GetHandler(config Config) http.HandlerFunc {
|
|||
mime := mime.TypeByExtension(ext)
|
||||
if mime == "" {
|
||||
http.Error(w, "MIME type detection error.", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
// Fail if MIME type is forbidden
|
||||
_, ok := config.BadMimesMap[mime]
|
||||
|
|
Loading…
Reference in New Issue