aboutsummaryrefslogtreecommitdiffhomepage
path: root/caddytest
diff options
context:
space:
mode:
authorFrancis Lavoie <[email protected]>2024-04-17 14:19:14 -0400
committerGitHub <[email protected]>2024-04-17 12:19:14 -0600
commit9cd472c0313b01e71d1f142769c3653058d75c86 (patch)
tree2393ff4a9a2280e35acfacf4109ca99075c26a43 /caddytest
parente0daa39cd3373d26dcf78ae0d30ac24d1df5dd57 (diff)
downloadcaddy-9cd472c0313b01e71d1f142769c3653058d75c86.tar.gz
caddy-9cd472c0313b01e71d1f142769c3653058d75c86.zip
caddyfile: Populate regexp matcher names by default (#6145)
* caddyfile: Populate regexp matcher names by default * Some lint cleanup that my VSCode complained about * Pass down matcher name through expression matcher * Compat with #6113: fix adapt test, set both styles in replacer
Diffstat (limited to 'caddytest')
-rw-r--r--caddytest/integration/caddyfile_adapt/expression_quotes.caddyfiletest10
-rw-r--r--caddytest/integration/caddyfile_adapt/matcher_syntax.caddyfiletest6
-rw-r--r--caddytest/integration/caddyfile_adapt/shorthand_parameterized_placeholders.caddyfiletest1
3 files changed, 14 insertions, 3 deletions
diff --git a/caddytest/integration/caddyfile_adapt/expression_quotes.caddyfiletest b/caddytest/integration/caddyfile_adapt/expression_quotes.caddyfiletest
index f5f8983eb..e0f5bd715 100644
--- a/caddytest/integration/caddyfile_adapt/expression_quotes.caddyfiletest
+++ b/caddytest/integration/caddyfile_adapt/expression_quotes.caddyfiletest
@@ -84,7 +84,10 @@ abort @e
],
"match": [
{
- "expression": "{http.error.status_code} == 403"
+ "expression": {
+ "expr": "{http.error.status_code} == 403",
+ "name": "d"
+ }
}
]
},
@@ -97,7 +100,10 @@ abort @e
],
"match": [
{
- "expression": "{http.error.status_code} == 404"
+ "expression": {
+ "expr": "{http.error.status_code} == 404",
+ "name": "e"
+ }
}
]
}
diff --git a/caddytest/integration/caddyfile_adapt/matcher_syntax.caddyfiletest b/caddytest/integration/caddyfile_adapt/matcher_syntax.caddyfiletest
index ffab2c70d..0ccee395c 100644
--- a/caddytest/integration/caddyfile_adapt/matcher_syntax.caddyfiletest
+++ b/caddytest/integration/caddyfile_adapt/matcher_syntax.caddyfiletest
@@ -146,6 +146,7 @@
{
"vars_regexp": {
"{http.request.uri}": {
+ "name": "matcher6",
"pattern": "\\.([a-f0-9]{6})\\.(css|js)$"
}
}
@@ -161,7 +162,10 @@
{
"match": [
{
- "expression": "path('/foo*') \u0026\u0026 method('GET')"
+ "expression": {
+ "expr": "path('/foo*') \u0026\u0026 method('GET')",
+ "name": "matcher7"
+ }
}
],
"handle": [
diff --git a/caddytest/integration/caddyfile_adapt/shorthand_parameterized_placeholders.caddyfiletest b/caddytest/integration/caddyfile_adapt/shorthand_parameterized_placeholders.caddyfiletest
index 30bc2c128..ef8d2330b 100644
--- a/caddytest/integration/caddyfile_adapt/shorthand_parameterized_placeholders.caddyfiletest
+++ b/caddytest/integration/caddyfile_adapt/shorthand_parameterized_placeholders.caddyfiletest
@@ -36,6 +36,7 @@ respond @match "{re.1}"
"match": [
{
"path_regexp": {
+ "name": "match",
"pattern": "^/foo(.*)$"
}
}