summaryrefslogtreecommitdiffhomepage
path: root/caddytest
diff options
context:
space:
mode:
authorFrancis Lavoie <[email protected]>2020-11-02 18:05:01 -0500
committerGitHub <[email protected]>2020-11-02 16:05:01 -0700
commitb4f49e2962201a87037f451a0b68323524828a58 (patch)
treeec68757df5504790ac2ef2d811861351624c4471 /caddytest
parentdd26875ffcbec8b74234bdda64e019a8a20c37e2 (diff)
downloadcaddy-b4f49e2962201a87037f451a0b68323524828a58.tar.gz
caddy-b4f49e2962201a87037f451a0b68323524828a58.zip
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
Diffstat (limited to 'caddytest')
-rw-r--r--caddytest/integration/caddyfile_adapt/matcher_syntax.txt28
1 files changed, 28 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/matcher_syntax.txt b/caddytest/integration/caddyfile_adapt/matcher_syntax.txt
index 55c06ea01..c5c276075 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"
+ }
+ ]
}
]
}