summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-04-22 19:57:06 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-04-22 19:57:06 -0600
commit1b061815b2a336ce4f8d1d3ce3054dab19e00745 (patch)
tree08ac1e04a4c98f8c9329a66ab708209f2d6c09d3 /modules/caddyhttp/reverseproxy
parent026937fab54de4a840e25e676cd8998030a6778a (diff)
reverseproxy: Don't forget to provision embedded headers handler
https://caddy.community/t/set-cookie-manipulation-in-reverse-proxy/7666?u=matt
Diffstat (limited to 'modules/caddyhttp/reverseproxy')
-rw-r--r--modules/caddyhttp/reverseproxy/reverseproxy.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/caddyhttp/reverseproxy/reverseproxy.go b/modules/caddyhttp/reverseproxy/reverseproxy.go
index e322a74..9e0f636 100644
--- a/modules/caddyhttp/reverseproxy/reverseproxy.go
+++ b/modules/caddyhttp/reverseproxy/reverseproxy.go
@@ -135,6 +135,16 @@ func (h *Handler) Provision(ctx caddy.Context) error {
h.CB = mod.(CircuitBreaker)
}
+ // ensure any embedded headers handler module gets provisioned
+ // (see https://caddy.community/t/set-cookie-manipulation-in-reverse-proxy/7666?u=matt
+ // for what happens if we forget to provision it)
+ if h.Headers != nil {
+ err := h.Headers.Provision(ctx)
+ if err != nil {
+ return fmt.Errorf("provisioning embedded headers handler: %v", err)
+ }
+ }
+
// set up transport
if h.Transport == nil {
t := &HTTPTransport{