@marcel91200 / caddy Mirror · read-only / commits / 1b061815
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

reverseproxy: Don't forget to provision embedded headers handler

https://caddy.community/t/set-cookie-manipulation-in-reverse-proxy/7666?u=matt

Matthew Holt committed Apr 22, 2020 at 19:57 UTC 1b061815b2a336ce4f8d1d3ce3054dab19e00745
1 file changed +10
modules/caddyhttp/reverseproxy/reverseproxy.go
+10
@@ -135,6 +135,16 @@ func (h *Handler) Provision(ctx caddy.Context) error {
135 h.CB = mod.(CircuitBreaker)
136 }
137
138 + // ensure any embedded headers handler module gets provisioned
139 + // (see https://caddy.community/t/set-cookie-manipulation-in-reverse-proxy/7666?u=matt
140 + // for what happens if we forget to provision it)
141 + if h.Headers != nil {
142 + err := h.Headers.Provision(ctx)
143 + if err != nil {
144 + return fmt.Errorf("provisioning embedded headers handler: %v", err)
145 + }
146 + }
147 +
148 // set up transport
149 if h.Transport == nil {
150 t := &HTTPTransport{