aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2016-07-03 16:16:01 +0200
committerclsr <clsr@clsr.net>2016-07-03 16:16:01 +0200
commit244da8ad70fbda7f9c97051d9c3d8901e143f9cc (patch)
treeb23da01558fc7272e9d49b19e05c8743dd0e2cc4
parentcf61ffa9c7947ea6446ddc5bea4febbc778beec9 (diff)
downloadgomf-244da8ad70fbda7f9c97051d9c3d8901e143f9cc.tar.gz
gomf-244da8ad70fbda7f9c97051d9c3d8901e143f9cc.zip
Default to application/octet-stream when lacking MIME typev0.4.1
-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 != "" {