mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 18:30:56 +00:00
static file name default lower case
This commit is contained in:
parent
95ef4c7136
commit
b9fb3a62f5
14
config.go
14
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 {
|
|
||||||
StaticExtensionsToGzip = []string{}
|
|
||||||
for _, ext := range extensions {
|
for _, ext := range extensions {
|
||||||
if len(ext) == 0 {
|
ext = strings.TrimSpace(ext)
|
||||||
|
if ext == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
extWithDot := ext
|
ext = strings.ToLower(ext)
|
||||||
if extWithDot[:1] != "." {
|
if !strings.HasPrefix(ext, ".") {
|
||||||
extWithDot = "." + extWithDot
|
ext = "." + ext
|
||||||
}
|
|
||||||
StaticExtensionsToGzip = append(StaticExtensionsToGzip, extWithDot)
|
|
||||||
}
|
}
|
||||||
|
StaticExtensionsToGzip = append(StaticExtensionsToGzip, ext)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user