consistent gzip logic

local store gzip same as replicated writes
This commit is contained in:
Chris Lu 2020-03-15 04:15:40 -07:00
parent 560df51def
commit 22400c6633

View File

@ -55,7 +55,7 @@ func ParseUpload(r *http.Request, sizeLimit int64) (pu *ParsedUpload, e error) {
pu.OriginalDataSize = len(unzipped)
pu.UncompressedData = unzipped
}
} else if shouldGzip, _ := util.IsGzippableFileType("", pu.MimeType); shouldGzip {
} else if shouldGzip, _ := util.IsGzippableFileType("", pu.MimeType); pu.MimeType == "" || shouldGzip {
if compressedData, err := util.GzipData(pu.Data); err == nil {
pu.Data = compressedData
pu.IsGzipped = true