httpcaddyfile: Allow nameless regexp placeholder shorthand (#6113)

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
Francis Lavoie 2024-03-05 18:37:14 -05:00 committed by GitHub
parent 01d5568b20
commit 2a78c9c5e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 1 deletions

View file

@ -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": {
@ -22,6 +26,21 @@ respond * "{header.content-type} {labels.0} {query.p} {path.0} {re.name.0}"
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"body": "{http.regexp.1}",
"handler": "static_response"
}
],
"match": [
{
"path_regexp": {
"pattern": "^/foo(.*)$"
}
}
]
},
{
"handle": [
{