From b835330714afcef2ec08662ffd2fd1043b62984f Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 7 Apr 2016 14:32:01 +0100 Subject: [PATCH] Use "application/octet-stream" if mime.TypeByExtension returns invalid type Fixes #424 --- fs/operations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/operations.go b/fs/operations.go index 43a65a077..f320047e8 100644 --- a/fs/operations.go +++ b/fs/operations.go @@ -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