1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 19:00:54 +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 gzipMinLength = minLength
} }
gzipCompressLevel = compressLevel gzipCompressLevel = compressLevel
if gzipCompressLevel < flate.DefaultCompression || gzipCompressLevel > flate.BestCompression { if gzipCompressLevel < flate.NoCompression || gzipCompressLevel > flate.BestCompression {
gzipCompressLevel = flate.BestSpeed gzipCompressLevel = flate.BestSpeed
} }
getMethodOnly = (len(methods) == 0) || (len(methods) == 1 && strings.ToUpper(methods[0]) == "GET") getMethodOnly = (len(methods) == 0) || (len(methods) == 1 && strings.ToUpper(methods[0]) == "GET")