-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
httpcaddyfile: Rewrite
root
parsing to allow omitting matcher
- Loading branch information
1 parent
58ab3a0
commit 60febe8
Showing
2 changed files
with
144 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
caddytest/integration/caddyfile_adapt/root_directive_permutations.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
:8080 | ||
|
||
# With explicit wildcard matcher | ||
route { | ||
root * /a | ||
} | ||
|
||
# With path matcher | ||
route { | ||
root /path /b | ||
} | ||
|
||
# With named matcher | ||
route { | ||
@named method GET | ||
root @named /c | ||
} | ||
|
||
# With no matcher, assumed to be wildcard | ||
route { | ||
root /d | ||
} | ||
---------- | ||
{ | ||
"apps": { | ||
"http": { | ||
"servers": { | ||
"srv0": { | ||
"listen": [ | ||
":8080" | ||
], | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"handler": "subroute", | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"handler": "vars", | ||
"root": "/a" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"handler": "subroute", | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"handler": "vars", | ||
"root": "/b" | ||
} | ||
], | ||
"match": [ | ||
{ | ||
"path": [ | ||
"/path" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"handler": "subroute", | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"handler": "vars", | ||
"root": "/c" | ||
} | ||
], | ||
"match": [ | ||
{ | ||
"method": [ | ||
"GET" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"handler": "subroute", | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"handler": "vars", | ||
"root": "/d" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |