From aeba225c87119087077fe88a9f6b68debe341553 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 29 Mar 2024 00:49:54 -0400 Subject: [PATCH] fix: only set the Content-Type header if we actually have a mime type, else let ServeContent detect it. --- api/s5/s5.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/s5/s5.go b/api/s5/s5.go index 258071a..030a20a 100644 --- a/api/s5/s5.go +++ b/api/s5/s5.go @@ -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) }