mirror of
https://github.com/astaxie/beego.git
synced 2024-11-23 01:00:57 +00:00
file extensions bug fixed
This commit is contained in:
parent
f708ce0299
commit
936cb735e1
@ -523,7 +523,7 @@ func ParseConfig() (err error) {
|
|||||||
|
|
||||||
if sgz := AppConfig.String("StaticExtensionsToGzip"); sgz != "" {
|
if sgz := AppConfig.String("StaticExtensionsToGzip"); sgz != "" {
|
||||||
extensions := strings.Split(sgz, ",")
|
extensions := strings.Split(sgz, ",")
|
||||||
StaticExtensionsToGzip = []string{}
|
fileExts := []string{}
|
||||||
for _, ext := range extensions {
|
for _, ext := range extensions {
|
||||||
ext = strings.TrimSpace(ext)
|
ext = strings.TrimSpace(ext)
|
||||||
if ext == "" {
|
if ext == "" {
|
||||||
@ -533,7 +533,10 @@ func ParseConfig() (err error) {
|
|||||||
if !strings.HasPrefix(ext, ".") {
|
if !strings.HasPrefix(ext, ".") {
|
||||||
ext = "." + ext
|
ext = "." + ext
|
||||||
}
|
}
|
||||||
StaticExtensionsToGzip = append(StaticExtensionsToGzip, ext)
|
fileExts = append(fileExts, ext)
|
||||||
|
}
|
||||||
|
if len(fileExts) > 0 {
|
||||||
|
StaticExtensionsToGzip = fileExts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user