From 8c3e25b38a66629cf4ef38bb1b7f09daab955bd6 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 7 Mar 2020 06:07:56 -0800 Subject: [PATCH] mimee type default "application/octet-stream" to empty string --- weed/command/filer_copy.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go index 8c01cfd74..fa948249a 100644 --- a/weed/command/filer_copy.go +++ b/weed/command/filer_copy.go @@ -493,9 +493,12 @@ func detectMimeType(f *os.File) string { } if err != nil { fmt.Printf("read head of %v: %v\n", f.Name(), err) - return "application/octet-stream" + return "" } f.Seek(0, io.SeekStart) mimeType := http.DetectContentType(head[:n]) + if mimeType == "application/octet-stream" { + return "" + } return mimeType }