mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-31 01:05:16 +08:00
gzip: Allow empty extension (#509)
This commit is contained in:
parent
e74558eaea
commit
0d8526b7d9
@ -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…
x
Reference in New Issue
Block a user