Browse Source

mimee type default "application/octet-stream" to empty string

tikv
Chris Lu 5 years ago
parent
commit
8c3e25b38a
  1. 5
      weed/command/filer_copy.go

5
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
}
Loading…
Cancel
Save