mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 15:39:58 +00:00
TUN-7073: Fix propagating of bad stream request from origin to downstream
This changes fixes a bug where cloudflared was not propagating errors when proxying the body of an HTTP request. In a situation where we already sent HTTP status code, the eyeball would see the request as sucessfully when in fact it wasn't. To solve this, we need to guarantee that we produce HTTP RST_STREAM frames. This change was applied to both http2 and quic transports.
This commit is contained in:
@@ -261,7 +261,9 @@ func (p *Proxy) proxyHTTPRequest(
|
||||
return nil
|
||||
}
|
||||
|
||||
_, _ = cfio.Copy(w, resp.Body)
|
||||
if _, err = cfio.Copy(w, resp.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// copy trailers
|
||||
copyTrailers(w, resp)
|
||||
|
Reference in New Issue
Block a user