1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 21:01:31 +00:00

file extensions bug fixed

This commit is contained in:
JessonChan 2015-09-22 13:27:35 +08:00
parent f708ce0299
commit 936cb735e1

View File

@ -523,7 +523,7 @@ func ParseConfig() (err error) {
if sgz := AppConfig.String("StaticExtensionsToGzip"); sgz != "" {
extensions := strings.Split(sgz, ",")
StaticExtensionsToGzip = []string{}
fileExts := []string{}
for _, ext := range extensions {
ext = strings.TrimSpace(ext)
if ext == "" {
@ -533,7 +533,10 @@ func ParseConfig() (err error) {
if !strings.HasPrefix(ext, ".") {
ext = "." + ext
}
StaticExtensionsToGzip = append(StaticExtensionsToGzip, ext)
fileExts = append(fileExts, ext)
}
if len(fileExts) > 0 {
StaticExtensionsToGzip = fileExts
}
}