Browse Source
reverseproxy: Abort active health checks on context cancellation
master
Matthew Holt
4 years ago
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5
1 changed files with
2 additions and
3 deletions
-
modules/caddyhttp/reverseproxy/healthchecks.go
|
|
@ -216,9 +216,8 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, host H |
|
|
|
u.Host = net.JoinHostPort(host, portStr) |
|
|
|
} |
|
|
|
|
|
|
|
// attach dialing information to this request - TODO: use caddy.Context's context
|
|
|
|
// so it can be canceled on config reload
|
|
|
|
ctx := context.Background() |
|
|
|
// attach dialing information to this request
|
|
|
|
ctx := h.ctx.Context |
|
|
|
ctx = context.WithValue(ctx, caddy.ReplacerCtxKey, caddy.NewReplacer()) |
|
|
|
ctx = context.WithValue(ctx, caddyhttp.VarsCtxKey, map[string]interface{}{ |
|
|
|
dialInfoVarKey: dialInfo, |
|
|
|