fix: only set the Content-Type header if we actually have a mime type, else let ServeContent detect it.
This commit is contained in:
parent
5ad1aaeb6a
commit
aeba225c87
|
@ -1991,7 +1991,9 @@ func (s *S5API) downloadFile(jc jape.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(file.Mime()) > 0 {
|
||||||
jc.ResponseWriter.Header().Set("Content-Type", file.Mime())
|
jc.ResponseWriter.Header().Set("Content-Type", file.Mime())
|
||||||
|
}
|
||||||
|
|
||||||
http.ServeContent(jc.ResponseWriter, jc.Request, file.Name(), file.Modtime(), file)
|
http.ServeContent(jc.ResponseWriter, jc.Request, file.Name(), file.Modtime(), file)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue