Better guessing mime type with octstream
This commit is contained in:
@@ -102,7 +102,10 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
|
|||||||
mtype = mime.TypeByExtension(ext)
|
mtype = mime.TypeByExtension(ext)
|
||||||
}
|
}
|
||||||
if n.MimeSize > 0 {
|
if n.MimeSize > 0 {
|
||||||
mtype = string(n.Mime)
|
mt := string(n.Mime)
|
||||||
|
if mt != "application/octet-stream" {
|
||||||
|
mtype = mt
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if mtype != "" {
|
if mtype != "" {
|
||||||
w.Header().Set("Content-Type", mtype)
|
w.Header().Set("Content-Type", mtype)
|
||||||
|
|||||||
Reference in New Issue
Block a user