Merge pull request #927 from pedronasser/master

fix rewrite if problem (skip remaining args)
This commit is contained in:
Pedro Nasser authored and GitHub committed 2016-07-08 14:52:45 -03:00
commit 7eb4bb8e1c
2 files changed
+7

No files matched your search

+1
View File
@@ -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()
+6
View File
@@ -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 {