-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
httpcaddyfile: Fix sorting edgecase for nested
handle_path
(#4477)
- Loading branch information
1 parent
78b5356
commit 81ee34e
Showing
3 changed files
with
150 additions
and
7 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
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
133 changes: 133 additions & 0 deletions
133
caddytest/integration/caddyfile_adapt/sort_directives_within_handle.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,133 @@ | ||
*.example.com { | ||
@foo host foo.example.com | ||
handle @foo { | ||
handle_path /strip* { | ||
respond "this should be first" | ||
} | ||
handle { | ||
respond "this should be second" | ||
} | ||
} | ||
handle { | ||
respond "this should be last" | ||
} | ||
} | ||
---------- | ||
{ | ||
"apps": { | ||
"http": { | ||
"servers": { | ||
"srv0": { | ||
"listen": [ | ||
":443" | ||
], | ||
"routes": [ | ||
{ | ||
"match": [ | ||
{ | ||
"host": [ | ||
"*.example.com" | ||
] | ||
} | ||
], | ||
"handle": [ | ||
{ | ||
"handler": "subroute", | ||
"routes": [ | ||
{ | ||
"group": "group5", | ||
"handle": [ | ||
{ | ||
"handler": "subroute", | ||
"routes": [ | ||
{ | ||
"group": "group2", | ||
"handle": [ | ||
{ | ||
"handler": "subroute", | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"handler": "rewrite", | ||
"strip_path_prefix": "/strip" | ||
} | ||
] | ||
}, | ||
{ | ||
"handle": [ | ||
{ | ||
"body": "this should be first", | ||
"handler": "static_response" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"match": [ | ||
{ | ||
"path": [ | ||
"/strip*" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"group": "group2", | ||
"handle": [ | ||
{ | ||
"handler": "subroute", | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"body": "this should be second", | ||
"handler": "static_response" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"match": [ | ||
{ | ||
"host": [ | ||
"foo.example.com" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"group": "group5", | ||
"handle": [ | ||
{ | ||
"handler": "subroute", | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"body": "this should be last", | ||
"handler": "static_response" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"terminal": true | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |