Use content type from request only if not empty
This commit is contained in:
parent
81fa050147
commit
d3c07e1dc1
|
@ -113,7 +113,10 @@ func Upload(w http.ResponseWriter, r *http.Request) {
|
|||
file.Read(b)
|
||||
fType := http.DetectContentType(b)
|
||||
if fType == "application/octet-stream" {
|
||||
fType = fheader.Header.Get("Content-Type")
|
||||
hType := fheader.Header.Get("Content-Type")
|
||||
if hType != "" {
|
||||
fType = hType
|
||||
}
|
||||
}
|
||||
|
||||
resId, tx, err := db.Db.InsertFile(fheader.Filename, fheader.Size, fType, sum, auth)
|
||||
|
|
Loading…
Reference in New Issue