aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/api.go b/api.go
index 2e5229b..e77cd2a 100644
--- a/api.go
+++ b/api.go
@@ -31,6 +31,9 @@ func handleFile(w http.ResponseWriter, r *http.Request) {
if !allowHtml && (strings.Index(mtype, "text/html") == 0 || strings.Index(mtype, "application/xhtml+xml") == 0) {
mtype = "text/plain"
}
+ if mtype == "" {
+ mtype = "application/octet-stream"
+ }
w.Header().Set("Content-Type", mtype)
_ = size
if csp != "" {