gzip: Allow empty extension (#509)

This commit is contained in:
Matthew Holt
2016-01-15 11:59:05 -07:00
parent e74558eaea
commit 0d8526b7d9
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ func gzipParse(c *Controller) ([]gzip.Config, error) {
return configs, c.ArgErr()
}
for _, e := range exts {
if !strings.HasPrefix(e, ".") && e != gzip.ExtWildCard {
if !strings.HasPrefix(e, ".") && e != gzip.ExtWildCard && e != "" {
return configs, fmt.Errorf(`gzip: invalid extension "%v" (must start with dot)`, e)
}
extFilter.Exts.Add(e)
+3
View File
@@ -50,6 +50,9 @@ func TestGzip(t *testing.T) {
level 1
}
gzip`, false},
{`gzip {
ext ""
}`, false},
{`gzip { not /file
ext .html
level 1