diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-04-14 10:52:53 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-04-14 10:52:53 -0700 |
| commit | d2d15978502ff3b45b010f546beaf226321dddb1 (patch) | |
| tree | 7a30bb98a78610e4809bca403e0ca36ea7706b45 | |
| parent | 23715af402293bd746645bb3ab7104071f93f372 (diff) | |
| download | seaweedfs-d2d15978502ff3b45b010f546beaf226321dddb1.tar.xz seaweedfs-d2d15978502ff3b45b010f546beaf226321dddb1.zip | |
volume: detect gzip effectiveness only when content type is empty
revert part of https://github.com/chrislusf/seaweedfs/commit/2286eda575861cceb4464bf677e9885e069de385
| -rw-r--r-- | weed/operation/upload_content.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index f6f3d0dcc..f582c4279 100644 --- a/weed/operation/upload_content.go +++ b/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 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% |
