diff options
author | Kévin Dunglas <[email protected]> | 2024-05-13 19:38:18 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-13 17:38:18 +0000 |
commit | fb63e2e40ca34122849e63da85952246bf6bc6f1 (patch) | |
tree | 2fed9fab0fb46772694cb88edab8ebee3e639d19 /caddyconfig | |
parent | 583c585c81ac4bcf94fb2046b695f64a83b41cf7 (diff) | |
download | caddy-fb63e2e40ca34122849e63da85952246bf6bc6f1.tar.gz caddy-fb63e2e40ca34122849e63da85952246bf6bc6f1.zip |
caddyhttp: New experimental handler for intercepting responses (#6232)
* feat: add generic response interceptors
* fix: cs
* rename intercept
* add some docs
* @francislavoie review (first round)
* Update modules/caddyhttp/intercept/intercept.go
Co-authored-by: Francis Lavoie <[email protected]>
* shorthands: ir to resp
* mark exported symbols as experimental
---------
Co-authored-by: Francis Lavoie <[email protected]>
Diffstat (limited to 'caddyconfig')
-rw-r--r-- | caddyconfig/httpcaddyfile/directives.go | 1 | ||||
-rw-r--r-- | caddyconfig/httpcaddyfile/shorthands.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/caddyconfig/httpcaddyfile/directives.go b/caddyconfig/httpcaddyfile/directives.go index 3e688ebcf..6972bb674 100644 --- a/caddyconfig/httpcaddyfile/directives.go +++ b/caddyconfig/httpcaddyfile/directives.go @@ -74,6 +74,7 @@ var defaultDirectiveOrder = []string{ "request_header", "encode", "push", + "intercept", "templates", // special routing & dispatching directives diff --git a/caddyconfig/httpcaddyfile/shorthands.go b/caddyconfig/httpcaddyfile/shorthands.go index 5855d127c..5d9ef31eb 100644 --- a/caddyconfig/httpcaddyfile/shorthands.go +++ b/caddyconfig/httpcaddyfile/shorthands.go @@ -36,6 +36,7 @@ func NewShorthandReplacer() ShorthandReplacer { {regexp.MustCompile(`{re\.([\w-\.]*)}`), "{http.regexp.$1}"}, {regexp.MustCompile(`{vars\.([\w-]*)}`), "{http.vars.$1}"}, {regexp.MustCompile(`{rp\.([\w-\.]*)}`), "{http.reverse_proxy.$1}"}, + {regexp.MustCompile(`{resp\.([\w-\.]*)}`), "{http.intercept.$1}"}, {regexp.MustCompile(`{err\.([\w-\.]*)}`), "{http.error.$1}"}, {regexp.MustCompile(`{file_match\.([\w-]*)}`), "{http.matchers.file.$1}"}, } |