1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-25 22:54:13 +00:00

getMethodOnly assign fixed

This commit is contained in:
JessonChan 2016-03-18 15:18:00 +08:00
parent 9f21928a90
commit 4caf044be2

View File

@ -48,7 +48,7 @@ func InitGzip(cf config.Configer) {
gzipCompressLevel = flate.BestSpeed
}
methods := cf.DefaultStrings("includedMethods", []string{"GET"})
getMethodOnly = len(methods) == 1 && strings.ToUpper(methods[0]) == "GET"
getMethodOnly = (len(methods) == 0) || (len(methods) == 1 && strings.ToUpper(methods[0]) == "GET")
for _, v := range methods {
includedMethods[strings.ToUpper(v)] = true
}