From f4667c6345b662420a9562be13333a1b348bfa33 Mon Sep 17 00:00:00 2001 From: Devin Carr Date: Fri, 17 Jun 2022 14:39:38 -0700 Subject: [PATCH] TUN-6427: Differentiate between upstream request closed/canceled and failed origin requests --- proxy/proxy.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy/proxy.go b/proxy/proxy.go index e31dc75b..19f14778 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -196,6 +196,9 @@ func (p *Proxy) proxyHTTPRequest( resp, err := httpService.RoundTrip(roundTripReq) if err != nil { tracing.EndWithErrorStatus(ttfbSpan, err) + if err := roundTripReq.Context().Err(); err != nil { + return errors.Wrap(err, "Incoming request ended abruptly") + } return errors.Wrap(err, "Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared") }