mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-07 11:28:48 +03:00
fix rewrite if problem (skip remaining args)
This commit is contained in:
parent
88a2811e2a
commit
39e55072d7
2 changed files with 7 additions and 0 deletions
|
@ -92,6 +92,7 @@ func rewriteParse(c *caddy.Controller) ([]Rule, error) {
|
|||
}
|
||||
default:
|
||||
if httpserver.IfMatcherKeyword(c.Val()) {
|
||||
c.RemainingArgs()
|
||||
continue block
|
||||
}
|
||||
return nil, c.ArgErr()
|
||||
|
|
|
@ -179,6 +179,12 @@ func TestRewriteParse(t *testing.T) {
|
|||
}`, true, []Rule{
|
||||
&ComplexRule{},
|
||||
}},
|
||||
{`rewrite {
|
||||
if {path} match /
|
||||
to /to
|
||||
}`, false, []Rule{
|
||||
&ComplexRule{Base: "/", To: "/to"},
|
||||
}},
|
||||
}
|
||||
|
||||
for i, test := range regexpTests {
|
||||
|
|
Loading…
Reference in a new issue