mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 06:10:56 +00:00
parent
1abf85ed2a
commit
860568cb6c
@ -529,7 +529,6 @@ func ParseConfig() (err error) {
|
|||||||
if ext == "" {
|
if ext == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
ext = strings.ToLower(ext)
|
|
||||||
if !strings.HasPrefix(ext, ".") {
|
if !strings.HasPrefix(ext, ".") {
|
||||||
ext = "." + ext
|
ext = "." + ext
|
||||||
}
|
}
|
||||||
|
@ -206,9 +206,9 @@ func getAcceptEncodingZip(r *http.Request) string {
|
|||||||
ss = strings.ToLower(ss)
|
ss = strings.ToLower(ss)
|
||||||
if strings.Contains(ss, "gzip") {
|
if strings.Contains(ss, "gzip") {
|
||||||
return "gzip"
|
return "gzip"
|
||||||
}
|
} else if strings.Contains(ss, "deflate") {
|
||||||
if strings.Contains(ss, "deflate") {
|
|
||||||
return "deflate"
|
return "deflate"
|
||||||
|
} else {
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
return ""
|
|
||||||
}
|
}
|
||||||
|
@ -96,9 +96,8 @@ func serverStaticRouter(ctx *context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isStaticFileToCompress := false
|
isStaticFileToCompress := false
|
||||||
lowerFileName := strings.ToLower(filePath)
|
|
||||||
for _, statExtension := range StaticExtensionsToGzip {
|
for _, statExtension := range StaticExtensionsToGzip {
|
||||||
if strings.HasSuffix(lowerFileName, statExtension) {
|
if strings.HasSuffix(strings.ToLower(filePath), strings.ToLower(statExtension)) {
|
||||||
isStaticFileToCompress = true
|
isStaticFileToCompress = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user