mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-18 21:07:56 +08:00
volume: detect gzip effectiveness only when content type is empty
revert part of 2286eda575
This commit is contained in:
@@ -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 len(data) > 128 {
|
||||
} else if 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%
|
||||
|
Reference in New Issue
Block a user