Browse Source

only detect when not sure about the types

pull/1278/head
Chris Lu 5 years ago
parent
commit
3f1d79512f
  1. 2
      weed/operation/upload_content.go

2
weed/operation/upload_content.go

@ -79,7 +79,7 @@ func doUploadData(uploadUrl string, filename string, cipher bool, data []byte, i
if !isInputGzipped {
if shouldBeZipped, iAmSure := util.IsGzippableFileType(filepath.Base(filename), mtype); iAmSure && shouldBeZipped {
shouldGzipNow = true
} else if mtype == "" && len(data) > 128 {
} else if !iAmSure && mtype == "" && len(data) > 128 {
var compressed []byte
compressed, err = util.GzipData(data[0:128])
shouldGzipNow = len(compressed)*10 < 128*9 // can not compress to less than 90%

Loading…
Cancel
Save