fix: only set the Content-Type header if we actually have a mime type, else let ServeContent detect it.

This commit is contained in:
Derrick Hammer 2024-03-29 00:49:54 -04:00
parent 5ad1aaeb6a
commit aeba225c87
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 1 deletions

View File

@ -1991,7 +1991,9 @@ func (s *S5API) downloadFile(jc jape.Context) {
return
}
jc.ResponseWriter.Header().Set("Content-Type", file.Mime())
if len(file.Mime()) > 0 {
jc.ResponseWriter.Header().Set("Content-Type", file.Mime())
}
http.ServeContent(jc.ResponseWriter, jc.Request, file.Name(), file.Modtime(), file)
}