summaryrefslogtreecommitdiff
path: root/caddytest
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2021-12-13 13:42:08 -0500
committerGitHub <noreply@github.com>2021-12-13 13:42:08 -0500
commit81ee34e9623c3ac630f46c81a26e7823d0b2bf7b (patch)
tree6c32a15a3fbe5f631728b7b4b4f3a47415f02fd5 /caddytest
parent78b5356f2b1945a90de1ef7f2c7669d82098edbd (diff)
httpcaddyfile: Fix sorting edgecase for nested `handle_path` (#4477)
Diffstat (limited to 'caddytest')
-rw-r--r--caddytest/integration/caddyfile_adapt/sort_directives_within_handle.txt133
1 files changed, 133 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/sort_directives_within_handle.txt b/caddytest/integration/caddyfile_adapt/sort_directives_within_handle.txt
new file mode 100644
index 0000000..10ff6da
--- /dev/null
+++ b/caddytest/integration/caddyfile_adapt/sort_directives_within_handle.txt
@@ -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
+ }
+ ]
+ }
+ }
+ }
+ }
+} \ No newline at end of file