mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 19:00:55 +00:00
static file name default lower case
This commit is contained in:
parent
95ef4c7136
commit
b9fb3a62f5
20
config.go
20
config.go
@ -523,18 +523,16 @@ func ParseConfig() (err error) {
|
|||||||
|
|
||||||
if sgz := AppConfig.String("StaticExtensionsToGzip"); sgz != "" {
|
if sgz := AppConfig.String("StaticExtensionsToGzip"); sgz != "" {
|
||||||
extensions := strings.Split(sgz, ",")
|
extensions := strings.Split(sgz, ",")
|
||||||
if len(extensions) > 0 {
|
for _, ext := range extensions {
|
||||||
StaticExtensionsToGzip = []string{}
|
ext = strings.TrimSpace(ext)
|
||||||
for _, ext := range extensions {
|
if ext == "" {
|
||||||
if len(ext) == 0 {
|
continue
|
||||||
continue
|
|
||||||
}
|
|
||||||
extWithDot := ext
|
|
||||||
if extWithDot[:1] != "." {
|
|
||||||
extWithDot = "." + extWithDot
|
|
||||||
}
|
|
||||||
StaticExtensionsToGzip = append(StaticExtensionsToGzip, extWithDot)
|
|
||||||
}
|
}
|
||||||
|
ext = strings.ToLower(ext)
|
||||||
|
if !strings.HasPrefix(ext, ".") {
|
||||||
|
ext = "." + ext
|
||||||
|
}
|
||||||
|
StaticExtensionsToGzip = append(StaticExtensionsToGzip, ext)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user