Debian Codegraph @

caddytest/integration/caddyfile_adapt/header_placeholder_search.caddyfiletest

raw
1 :80 {
2 header Test-Static ":443" "STATIC-WORKS"
3 header Test-Dynamic ":{http.request.local.port}" "DYNAMIC-WORKS"
4 header Test-Complex "port-{http.request.local.port}-end" "COMPLEX-{http.request.method}"
5 }
6 ----------
7 {
8 "apps": {
9 "http": {
10 "servers": {
11 "srv0": {
12 "listen": [
13 ":80"
14 ],
15 "routes": [
16 {
17 "handle": [
18 {
19 "handler": "headers",
20 "response": {
21 "replace": {
22 "Test-Static": [
23 {
24 "replace": "STATIC-WORKS",
25 "search_regexp": ":443"
26 }
27 ]
28 }
29 }
30 },
31 {
32 "handler": "headers",
33 "response": {
34 "replace": {
35 "Test-Dynamic": [
36 {
37 "replace": "DYNAMIC-WORKS",
38 "search_regexp": ":{http.request.local.port}"
39 }
40 ]
41 }
42 }
43 },
44 {
45 "handler": "headers",
46 "response": {
47 "replace": {
48 "Test-Complex": [
49 {
50 "replace": "COMPLEX-{http.request.method}",
51 "search_regexp": "port-{http.request.local.port}-end"
52 }
53 ]
54 }
55 }
56 }
57 ]
58 }
59 ]
60 }
61 }
62 }
63 }
64 }