Rewrite: Use middleware.Replacer for simple rule.

This commit is contained in:
Abiola Ibrahim
2015-11-24 12:20:39 +01:00
parent 0b51369932
commit 016344bae7
2 changed files with 7 additions and 1 deletions

View File

@ -17,6 +17,7 @@ func TestRewrite(t *testing.T) {
Rules: []Rule{
NewSimpleRule("/from", "/to"),
NewSimpleRule("/a", "/b"),
NewSimpleRule("/b", "/b{uri}"),
},
}
@ -50,6 +51,7 @@ func TestRewrite(t *testing.T) {
}{
{"/from", "/to"},
{"/a", "/b"},
{"/b", "/b/b"},
{"/aa", "/aa"},
{"/", "/"},
{"/a?foo=bar", "/b?foo=bar"},