Fix "Queries" matcher to support out-of-order query string parameters

This commit is contained in:
Raphael Simon
2014-05-27 09:34:08 -07:00
parent 0a0d6a1b2a
commit 69237eaae5
3 changed files with 42 additions and 35 deletions

View File

@@ -462,6 +462,15 @@ func TestQueries(t *testing.T) {
path: "",
shouldMatch: true,
},
{
title: "Queries route, match with a query string out of order",
route: new(Route).Host("www.example.com").Path("/api").Queries("foo", "bar", "baz", "ding"),
request: newRequest("GET", "http://www.example.com/api?baz=ding&foo=bar"),
vars: map[string]string{},
host: "",
path: "",
shouldMatch: true,
},
{
title: "Queries route, bad query",
route: new(Route).Queries("foo", "bar", "baz", "ding"),