Skip to content

Commit

Permalink
better tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dadrus committed Sep 11, 2024
1 parent fd45ef6 commit a7a4a67
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/rules/route_matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,13 @@ func TestPathParamsMatcherMatches(t *testing.T) {
{
uc: "matches with path having allowed but not decoded encoded slashes",
conf: []config.ParameterMatcher{
{Name: "foo", Type: "exact", Value: "bar%2Fbaz"},
{Name: "foo", Type: "exact", Value: "bar%2Fbaz[id]"},
},
slashHandling: config.EncodedSlashesOnNoDecode,
keys: []string{"foo"},
values: []string{"bar%2Fbaz"},
values: []string{"bar%2Fbaz%5Bid%5D"},
toMatch: func() url.URL {
uri, err := url.Parse("http://example.com/bar%2Fbaz")
uri, err := url.Parse("http://example.com/bar%2Fbaz%5Bid%5D")
require.NoError(t, err)

return *uri
Expand All @@ -439,13 +439,13 @@ func TestPathParamsMatcherMatches(t *testing.T) {
{
uc: "matches with path having allowed decoded slashes",
conf: []config.ParameterMatcher{
{Name: "foo", Type: "exact", Value: "bar/baz"},
{Name: "foo", Type: "exact", Value: "bar/baz[id]"},
},
slashHandling: config.EncodedSlashesOn,
keys: []string{"foo"},
values: []string{"bar%2Fbaz"},
values: []string{"bar%2Fbaz%5Bid%5D"},
toMatch: func() url.URL {
uri, err := url.Parse("http://example.com/bar%2Fbaz")
uri, err := url.Parse("http://example.com/foo%2Fbaz%5Bid%5D")
require.NoError(t, err)

return *uri
Expand Down

0 comments on commit a7a4a67

Please sign in to comment.