diff options
author | clsr <clsr@clsr.net> | 2016-07-03 16:16:01 +0200 |
---|---|---|
committer | clsr <clsr@clsr.net> | 2016-07-03 16:16:01 +0200 |
commit | 244da8ad70fbda7f9c97051d9c3d8901e143f9cc (patch) | |
tree | b23da01558fc7272e9d49b19e05c8743dd0e2cc4 /api.go | |
parent | cf61ffa9c7947ea6446ddc5bea4febbc778beec9 (diff) | |
download | gomf-244da8ad70fbda7f9c97051d9c3d8901e143f9cc.tar.gz gomf-244da8ad70fbda7f9c97051d9c3d8901e143f9cc.zip |
Default to application/octet-stream when lacking MIME typev0.4.1
Diffstat (limited to 'api.go')
-rw-r--r-- | api.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 != "" { |