Commit 39e55072 authored by Pedro Nasser's avatar Pedro Nasser

fix rewrite if problem (skip remaining args)

parent 88a2811e
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment