Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 13, 14:15 UTC
httpcaddyfile: Add `{cookie.*}` placeholder shortcut (#5001)
Francis Lavoie committed
Aug 31, 2022 at 12:18 UTC
68d8ac9802c5e7bf5bf55d1a3c1db634edc93999
1 file changed
+3
-2
caddyconfig/httpcaddyfile/httptype.go
+3
-2
@@ -91,10 +91,11 @@ func (st ServerType) Setup(inputServerBlocks []caddyfile.ServerBlock,
91
search *regexp.Regexp
92
replace string
93
}{
94
- {regexp.MustCompile(`{query\.([\w-]*)}`), "{http.request.uri.query.$1}"},
95
- {regexp.MustCompile(`{labels\.([\w-]*)}`), "{http.request.host.labels.$1}"},
94
{regexp.MustCompile(`{header\.([\w-]*)}`), "{http.request.header.$1}"},
95
+ {regexp.MustCompile(`{cookie\.([\w-]*)}`), "{http.request.cookie.$1}"},
96
+ {regexp.MustCompile(`{labels\.([\w-]*)}`), "{http.request.host.labels.$1}"},
97
{regexp.MustCompile(`{path\.([\w-]*)}`), "{http.request.uri.path.$1}"},
98
+ {regexp.MustCompile(`{query\.([\w-]*)}`), "{http.request.uri.query.$1}"},
99
{regexp.MustCompile(`{re\.([\w-]*)\.([\w-]*)}`), "{http.regexp.$1.$2}"},
100
{regexp.MustCompile(`{vars\.([\w-]*)}`), "{http.vars.$1}"},
101
{regexp.MustCompile(`{rp\.([\w-\.]*)}`), "{http.reverse_proxy.$1}"},