Skip to content

Commit a60d54d

Browse files
committed
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
1 parent acb8f0e commit a60d54d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/caddyhttp/reverseproxy/reverseproxy.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyht
224224

225225
// proxy the request to that upstream
226226
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
228230
return nil
229231
}
230232

0 commit comments

Comments
 (0)