mirror of
https://github.com/rclone/rclone.git
synced 2025-01-11 08:49:37 +01:00
Use "application/octet-stream" if mime.TypeByExtension returns invalid type
Fixes #424
This commit is contained in:
parent
310db14ed6
commit
b835330714
@ -166,7 +166,7 @@ func Equal(src, dst Object) bool {
|
||||
// MimeType returns a guess at the mime type from the extension
|
||||
func MimeType(o Object) string {
|
||||
mimeType := mime.TypeByExtension(path.Ext(o.Remote()))
|
||||
if mimeType == "" {
|
||||
if !strings.ContainsRune(mimeType, '/') {
|
||||
mimeType = "application/octet-stream"
|
||||
}
|
||||
return mimeType
|
||||
|
Loading…
Reference in New Issue
Block a user