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: Abort active health checks on context cancellation
Matthew Holt committed
Aug 31, 2020 at 13:22 UTC
724b74d98144e502d4cd7b2a4b1c2309e7536d4f
1 file changed
+2
-3
modules/caddyhttp/reverseproxy/healthchecks.go
+2
-3
@@ -216,9 +216,8 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, host H
216
u.Host = net.JoinHostPort(host, portStr)
217
}
218
219
- // attach dialing information to this request - TODO: use caddy.Context's context
220
- // so it can be canceled on config reload
221
- ctx := context.Background()
219
+ // attach dialing information to this request
220
+ ctx := h.ctx.Context
221
ctx = context.WithValue(ctx, caddy.ReplacerCtxKey, caddy.NewReplacer())
222
ctx = context.WithValue(ctx, caddyhttp.VarsCtxKey, map[string]interface{}{
223
dialInfoVarKey: dialInfo,