1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 19:00:54 +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 gzipCompressLevel = flate.BestSpeed
} }
methods := cf.DefaultStrings("includedMethods", []string{"GET"}) 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 { for _, v := range methods {
includedMethods[strings.ToUpper(v)] = true includedMethods[strings.ToUpper(v)] = true
} }