1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-23 03:04:12 +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 != "" {
extensions := strings.Split(sgz, ",")
if len(extensions) > 0 {
StaticExtensionsToGzip = []string{}
for _, ext := range extensions {
if len(ext) == 0 {
continue
}
extWithDot := ext
if extWithDot[:1] != "." {
extWithDot = "." + extWithDot
}
StaticExtensionsToGzip = append(StaticExtensionsToGzip, extWithDot)
for _, ext := range extensions {
ext = strings.TrimSpace(ext)
if ext == "" {
continue
}
ext = strings.ToLower(ext)
if !strings.HasPrefix(ext, ".") {
ext = "." + ext
}
StaticExtensionsToGzip = append(StaticExtensionsToGzip, ext)
}
}