From a7a4a67f9ed2504a5840722f3cb69042f9d52fa0 Mon Sep 17 00:00:00 2001 From: Dimitrij Drus Date: Wed, 11 Sep 2024 19:49:34 +0200 Subject: [PATCH] better tests --- internal/rules/route_matcher_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/rules/route_matcher_test.go b/internal/rules/route_matcher_test.go index 1d9db6fde..9ad4b047e 100644 --- a/internal/rules/route_matcher_test.go +++ b/internal/rules/route_matcher_test.go @@ -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 @@ -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