Debian Codegraph @

caddytest/integration/caddyfile_adapt/sort_directives_within_handle.caddyfiletest

raw
1 *.example.com {
2 @foo host foo.example.com
3 handle @foo {
4 handle_path /strip {
5 respond "this should be first"
6 }
7 handle_path /strip* {
8 respond "this should be second"
9 }
10 handle {
11 respond "this should be last"
12 }
13 }
14 handle {
15 respond "this should be last"
16 }
17 }
18 ----------
19 {
20 "apps": {
21 "http": {
22 "servers": {
23 "srv0": {
24 "listen": [
25 ":443"
26 ],
27 "routes": [
28 {
29 "match": [
30 {
31 "host": [
32 "*.example.com"
33 ]
34 }
35 ],
36 "handle": [
37 {
38 "handler": "subroute",
39 "routes": [
40 {
41 "group": "group6",
42 "handle": [
43 {
44 "handler": "subroute",
45 "routes": [
46 {
47 "group": "group3",
48 "handle": [
49 {
50 "handler": "subroute",
51 "routes": [
52 {
53 "handle": [
54 {
55 "handler": "rewrite",
56 "strip_path_prefix": "/strip"
57 }
58 ]
59 },
60 {
61 "handle": [
62 {
63 "body": "this should be first",
64 "handler": "static_response"
65 }
66 ]
67 }
68 ]
69 }
70 ],
71 "match": [
72 {
73 "path": [
74 "/strip"
75 ]
76 }
77 ]
78 },
79 {
80 "group": "group3",
81 "handle": [
82 {
83 "handler": "subroute",
84 "routes": [
85 {
86 "handle": [
87 {
88 "handler": "rewrite",
89 "strip_path_prefix": "/strip"
90 }
91 ]
92 },
93 {
94 "handle": [
95 {
96 "body": "this should be second",
97 "handler": "static_response"
98 }
99 ]
100 }
101 ]
102 }
103 ],
104 "match": [
105 {
106 "path": [
107 "/strip*"
108 ]
109 }
110 ]
111 },
112 {
113 "group": "group3",
114 "handle": [
115 {
116 "handler": "subroute",
117 "routes": [
118 {
119 "handle": [
120 {
121 "body": "this should be last",
122 "handler": "static_response"
123 }
124 ]
125 }
126 ]
127 }
128 ]
129 }
130 ]
131 }
132 ],
133 "match": [
134 {
135 "host": [
136 "foo.example.com"
137 ]
138 }
139 ]
140 },
141 {
142 "group": "group6",
143 "handle": [
144 {
145 "handler": "subroute",
146 "routes": [
147 {
148 "handle": [
149 {
150 "body": "this should be last",
151 "handler": "static_response"
152 }
153 ]
154 }
155 ]
156 }
157 ]
158 }
159 ]
160 }
161 ],
162 "terminal": true
163 }
164 ]
165 }
166 }
167 }
168 }
169 }