mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
revert temporary changes that disabled compression
fix https://github.com/chrislusf/seaweedfs/issues/2362
This commit is contained in:
parent
f3d8232e14
commit
332f5ad3a8
|
@ -75,16 +75,14 @@ func ParseUpload(r *http.Request, sizeLimit int64, bytesBuffer *bytes.Buffer) (p
|
||||||
if mimeType == "application/octet-stream" {
|
if mimeType == "application/octet-stream" {
|
||||||
mimeType = ""
|
mimeType = ""
|
||||||
}
|
}
|
||||||
if false {
|
if shouldBeCompressed, iAmSure := util.IsCompressableFileType(ext, mimeType); mimeType == "" && !iAmSure || shouldBeCompressed && iAmSure {
|
||||||
if shouldBeCompressed, iAmSure := util.IsCompressableFileType(ext, mimeType); mimeType == "" && !iAmSure || shouldBeCompressed && iAmSure {
|
// println("ext", ext, "iAmSure", iAmSure, "shouldBeCompressed", shouldBeCompressed, "mimeType", pu.MimeType)
|
||||||
// println("ext", ext, "iAmSure", iAmSure, "shouldBeCompressed", shouldBeCompressed, "mimeType", pu.MimeType)
|
if compressedData, err := util.GzipData(pu.Data); err == nil {
|
||||||
if compressedData, err := util.GzipData(pu.Data); err == nil {
|
if len(compressedData)*10 < len(pu.Data)*9 {
|
||||||
if len(compressedData)*10 < len(pu.Data)*9 {
|
pu.Data = compressedData
|
||||||
pu.Data = compressedData
|
pu.IsGzipped = true
|
||||||
pu.IsGzipped = true
|
|
||||||
}
|
|
||||||
// println("gzipped data size", len(compressedData))
|
|
||||||
}
|
}
|
||||||
|
// println("gzipped data size", len(compressedData))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue