From b4f49e2962201a87037f451a0b68323524828a58 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Mon, 2 Nov 2020 18:05:01 -0500 Subject: caddyhttp: Merge query matchers in Caddyfile (#3839) Also, turns out that `Add` on headers will work even if there's nothing there yet, so we can remove the condition I introduced in #3832 --- .../integration/caddyfile_adapt/matcher_syntax.txt | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'caddytest') diff --git a/caddytest/integration/caddyfile_adapt/matcher_syntax.txt b/caddytest/integration/caddyfile_adapt/matcher_syntax.txt index 55c06ea..c5c2760 100644 --- a/caddytest/integration/caddyfile_adapt/matcher_syntax.txt +++ b/caddytest/integration/caddyfile_adapt/matcher_syntax.txt @@ -25,6 +25,12 @@ header Bar foo } respond @matcher7 "header matcher merging values of the same field" + + @matcher8 { + query foo=bar foo=baz bar=foo + query bar=baz + } + respond @matcher8 "query matcher merging pairs with the same keys" } ---------- { @@ -155,6 +161,28 @@ "handler": "static_response" } ] + }, + { + "match": [ + { + "query": { + "bar": [ + "foo", + "baz" + ], + "foo": [ + "bar", + "baz" + ] + } + } + ], + "handle": [ + { + "body": "query matcher merging pairs with the same keys", + "handler": "static_response" + } + ] } ] } -- cgit v1.2.3