Return after serving an error when MIME type detection fails.

This commit is contained in:
Solderpunk 2019-06-05 20:53:50 +03:00
parent b37ce48228
commit aad4ebba8f
1 changed files with 1 additions and 0 deletions

View File

@ -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]