diff --git a/config.go b/config.go index 2761e7cb..15d11386 100644 --- a/config.go +++ b/config.go @@ -353,7 +353,7 @@ func (b *beegoAppConfig) String(key string) string { } func (b *beegoAppConfig) Strings(key string) []string { - if v := b.innerConfig.Strings(BConfig.RunMode + "::" + key); v[0] != "" { + if v := b.innerConfig.Strings(BConfig.RunMode + "::" + key); len(v) > 0 { return v } return b.innerConfig.Strings(key) diff --git a/context/acceptencoder.go b/context/acceptencoder.go index e73744f5..fc2775ce 100644 --- a/context/acceptencoder.go +++ b/context/acceptencoder.go @@ -49,6 +49,7 @@ func InitGzip(cf config.Configer) { } methods := cf.DefaultStrings("includedMethods", []string{"GET"}) getMethodOnly = (len(methods) == 0) || (len(methods) == 1 && strings.ToUpper(methods[0]) == "GET") + includedMethods = make(map[string]bool, len(methods)) for _, v := range methods { includedMethods[strings.ToUpper(v)] = true }