1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 23:40:50 +00:00

change the compress leve to [0~9]

This commit is contained in:
JessonChan 2016-03-22 16:47:11 +08:00
parent 4db78f243e
commit 7bad3d1c67

View File

@ -44,7 +44,7 @@ func InitGzip(minLength, compressLevel int, methods []string) {
gzipMinLength = minLength
}
gzipCompressLevel = compressLevel
if gzipCompressLevel < flate.DefaultCompression || gzipCompressLevel > flate.BestCompression {
if gzipCompressLevel < flate.NoCompression || gzipCompressLevel > flate.BestCompression {
gzipCompressLevel = flate.BestSpeed
}
getMethodOnly = (len(methods) == 0) || (len(methods) == 1 && strings.ToUpper(methods[0]) == "GET")