Commit 860568cb authored by JessonChan's avatar JessonChan

modified as astaxie reviews

https://github.com/astaxie/beego/pull/1376
parent 1abf85ed
......@@ -529,7 +529,6 @@ func ParseConfig() (err error) {
if ext == "" {
continue
}
ext = strings.ToLower(ext)
if !strings.HasPrefix(ext, ".") {
ext = "." + ext
}
......
......@@ -206,9 +206,9 @@ func getAcceptEncodingZip(r *http.Request) string {
ss = strings.ToLower(ss)
if strings.Contains(ss, "gzip") {
return "gzip"
}
if strings.Contains(ss, "deflate") {
} else if strings.Contains(ss, "deflate") {
return "deflate"
} else {
return ""
}
return ""
}
......@@ -96,9 +96,8 @@ func serverStaticRouter(ctx *context.Context) {
}
isStaticFileToCompress := false
lowerFileName := strings.ToLower(filePath)
for _, statExtension := range StaticExtensionsToGzip {
if strings.HasSuffix(lowerFileName, statExtension) {
if strings.HasSuffix(strings.ToLower(filePath), strings.ToLower(statExtension)) {
isStaticFileToCompress = true
break
}
......
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