mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 07:43:17 +00:00
httpcaddyfile: Allow nameless regexp placeholder shorthand (#6113)
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
parent
01d5568b20
commit
2a78c9c5e4
2 changed files with 20 additions and 1 deletions
|
@ -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": [
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue