mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-20 03:18:07 +08:00
mimee type default "application/octet-stream" to empty string
This commit is contained in:
@@ -493,9 +493,12 @@ func detectMimeType(f *os.File) string {
|
|||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("read head of %v: %v\n", f.Name(), err)
|
fmt.Printf("read head of %v: %v\n", f.Name(), err)
|
||||||
return "application/octet-stream"
|
return ""
|
||||||
}
|
}
|
||||||
f.Seek(0, io.SeekStart)
|
f.Seek(0, io.SeekStart)
|
||||||
mimeType := http.DetectContentType(head[:n])
|
mimeType := http.DetectContentType(head[:n])
|
||||||
|
if mimeType == "application/octet-stream" {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
return mimeType
|
return mimeType
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user