Commit 4caf044b authored by JessonChan's avatar JessonChan

getMethodOnly assign fixed

parent 9f21928a
...@@ -48,7 +48,7 @@ func InitGzip(cf config.Configer) { ...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment