mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 15:39:58 +00:00
TUN-6248: Fix panic in cloudflared during tracing when origin doesn't provide header map
This commit is contained in:
@@ -203,6 +203,11 @@ func (p *Proxy) proxyHTTPRequest(
|
||||
tracing.EndWithStatus(ttfbSpan, codes.Ok, resp.Status)
|
||||
defer resp.Body.Close()
|
||||
|
||||
// resp headers can be nil
|
||||
if resp.Header == nil {
|
||||
resp.Header = make(http.Header)
|
||||
}
|
||||
|
||||
// Add spans to response header (if available)
|
||||
tr.AddSpans(resp.Header, p.log)
|
||||
|
||||
|
Reference in New Issue
Block a user