mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
gzip: Allow empty extension (#509)
This commit is contained in:
parent
e74558eaea
commit
0d8526b7d9
2 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -50,6 +50,9 @@ func TestGzip(t *testing.T) {
|
|||
level 1
|
||||
}
|
||||
gzip`, false},
|
||||
{`gzip {
|
||||
ext ""
|
||||
}`, false},
|
||||
{`gzip { not /file
|
||||
ext .html
|
||||
level 1
|
||||
|
|
Loading…
Reference in a new issue