From 936cb735e18e42428d86ad0fdaf36d62cfe527d4 Mon Sep 17 00:00:00 2001 From: JessonChan Date: Tue, 22 Sep 2015 13:27:35 +0800 Subject: [PATCH] file extensions bug fixed --- config.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index c79437b1..c2f23f67 100644 --- a/config.go +++ b/config.go @@ -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 } }