Better guessing mime type with octstream

This commit is contained in:
Chris Lu 2014-06-08 21:02:20 -07:00
parent d2f3cab8e1
commit d7f6af09e6

View File

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