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
This commit is contained in:
Matthew Holt 2019-09-03 19:10:09 -06:00
parent acb8f0e0c2
commit a60d54dbfd
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5

View File

@ -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
}