|
@ -75,7 +75,7 @@ func ParseUpload(r *http.Request, sizeLimit int64, bytesBuffer *bytes.Buffer) (p |
|
|
if mimeType == "application/octet-stream" { |
|
|
if mimeType == "application/octet-stream" { |
|
|
mimeType = "" |
|
|
mimeType = "" |
|
|
} |
|
|
} |
|
|
if shouldBeCompressed, iAmSure := util.IsCompressableFileType(ext, mimeType); mimeType == "" && !iAmSure || shouldBeCompressed && iAmSure { |
|
|
|
|
|
|
|
|
if shouldBeCompressed, iAmSure := util.IsCompressableFileType(ext, mimeType); 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 { |
|
|