Browse Source

reverse_proxy: Ignore context.Canceled errors

These happen when downstream clients cancel the request, but that's not
our problem nor a failure in our end
master
Matthew Holt 6 years ago
parent
commit
a60d54dbfd
No known key found for this signature in database GPG Key ID: 2A349DD577D586A5
  1. 4
      modules/caddyhttp/reverseproxy/reverseproxy.go

4
modules/caddyhttp/reverseproxy/reverseproxy.go

@ -224,7 +224,9 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyht
// proxy the request to that upstream
proxyErr = h.reverseProxy(w, r, upstream)
if proxyErr == nil {
if proxyErr == nil || proxyErr == context.Canceled {
// context.Canceled happens when the downstream client
// cancels the request; we don't have to worry about that
return nil
}

Loading…
Cancel
Save