1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-30 11:34:14 +00:00

static file name default lower case

This commit is contained in:
JessonChan 2015-09-22 11:59:48 +08:00
parent 95ef4c7136
commit b9fb3a62f5

View File

@ -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)
} }
} }