Correct http code for uploaded file

This commit is contained in:
Jason Streifling 2024-10-04 16:46:29 +02:00
parent f28c204c52
commit 750184b8ef

View File

@ -46,7 +46,7 @@ func UploadPDF(c *b.Config, s *b.CookieStore) http.HandlerFunc {
} }
if http.DetectContentType(buffer) != "application/pdf" { if http.DetectContentType(buffer) != "application/pdf" {
http.Error(w, "Die Datei ist kein PDF.", http.StatusInternalServerError) http.Error(w, "Die Datei ist kein PDF.", http.StatusBadRequest)
return return
} }