@marcel91200 / caddy Mirror · read-only / commits / a60d54db
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

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

Matthew Holt committed Sep 3, 2019 at 19:10 UTC a60d54dbfd93f74187b4051f1522c42d34480503
1 file changed +3 -1
modules/caddyhttp/reverseproxy/reverseproxy.go
+3 -1
@@ -224,7 +224,9 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyht
224
225 // proxy the request to that upstream
226 proxyErr = h.reverseProxy(w, r, upstream)
227 - if proxyErr == nil {
227 + if proxyErr == nil || proxyErr == context.Canceled {
228 + // context.Canceled happens when the downstream client
229 + // cancels the request; we don't have to worry about that
230 return nil
231 }
232