From 244da8ad70fbda7f9c97051d9c3d8901e143f9cc Mon Sep 17 00:00:00 2001 From: clsr Date: Sun, 3 Jul 2016 16:16:01 +0200 Subject: Default to application/octet-stream when lacking MIME type --- api.go | 3 +++ 1 file changed, 3 insertions(+) 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 != "" { -- cgit