From 4caf044be2e7b18d52a6c525c7d5d209ed7d987a Mon Sep 17 00:00:00 2001 From: JessonChan Date: Fri, 18 Mar 2016 15:18:00 +0800 Subject: [PATCH] getMethodOnly assign fixed --- context/acceptencoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context/acceptencoder.go b/context/acceptencoder.go index bc048e77..e73744f5 100644 --- a/context/acceptencoder.go +++ b/context/acceptencoder.go @@ -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 }