TUN-6248: Fix panic in cloudflared during tracing when origin doesn't provide header map

This commit is contained in:
João Oliveirinha
2022-05-18 11:11:48 +01:00
parent 4b6437cc60
commit 26a7b59f6f
3 changed files with 30 additions and 0 deletions

View File

@@ -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)