Browse Source

Better guessing mime type with octstream

pull/2/head
Chris Lu 11 years ago
parent
commit
d7f6af09e6
  1. 5
      go/weed/weed_server/volume_server_handlers.go

5
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)

Loading…
Cancel
Save