diff options
author | Francis Lavoie <[email protected]> | 2024-03-05 18:37:14 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-03-05 23:37:14 +0000 |
commit | 2a78c9c5e428549fbb40b57b1bd78cf7746e37e3 (patch) | |
tree | b1d376be7ccac939b94bfcbb91b691c161e49db2 /caddytest | |
parent | 01d5568b20408a7f72fb53095e2e146f0c39672a (diff) | |
download | caddy-2a78c9c5e428549fbb40b57b1bd78cf7746e37e3.tar.gz caddy-2a78c9c5e428549fbb40b57b1bd78cf7746e37e3.zip |
httpcaddyfile: Allow nameless regexp placeholder shorthand (#6113)
Co-authored-by: Matt Holt <[email protected]>
Diffstat (limited to 'caddytest')
-rw-r--r-- | caddytest/integration/caddyfile_adapt/shorthand_parameterized_placeholders.caddyfiletest | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/shorthand_parameterized_placeholders.caddyfiletest b/caddytest/integration/caddyfile_adapt/shorthand_parameterized_placeholders.caddyfiletest index d5c35b3c3..30bc2c128 100644 --- a/caddytest/integration/caddyfile_adapt/shorthand_parameterized_placeholders.caddyfiletest +++ b/caddytest/integration/caddyfile_adapt/shorthand_parameterized_placeholders.caddyfiletest @@ -1,5 +1,9 @@ localhost:80 + respond * "{header.content-type} {labels.0} {query.p} {path.0} {re.name.0}" + +@match path_regexp ^/foo(.*)$ +respond @match "{re.1}" ---------- { "apps": { @@ -25,6 +29,21 @@ respond * "{header.content-type} {labels.0} {query.p} {path.0} {re.name.0}" { "handle": [ { + "body": "{http.regexp.1}", + "handler": "static_response" + } + ], + "match": [ + { + "path_regexp": { + "pattern": "^/foo(.*)$" + } + } + ] + }, + { + "handle": [ + { "body": "{http.request.header.content-type} {http.request.host.labels.0} {http.request.uri.query.p} {http.request.uri.path.0} {http.regexp.name.0}", "handler": "static_response" } |