From d7f6af09e6265c0d4ecef50879195f50d5ffdf30 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 8 Jun 2014 21:02:20 -0700 Subject: [PATCH] Better guessing mime type with octstream --- go/weed/weed_server/volume_server_handlers.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/go/weed/weed_server/volume_server_handlers.go b/go/weed/weed_server/volume_server_handlers.go index 70c1d70d5..ee57109ea 100644 --- a/go/weed/weed_server/volume_server_handlers.go +++ b/go/weed/weed_server/volume_server_handlers.go @@ -102,7 +102,10 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) mtype = mime.TypeByExtension(ext) } if n.MimeSize > 0 { - mtype = string(n.Mime) + mt := string(n.Mime) + if mt != "application/octet-stream" { + mtype = mt + } } if mtype != "" { w.Header().Set("Content-Type", mtype)