Skip to content

Commit

Permalink
Ignore more headers
Browse files Browse the repository at this point in the history
  • Loading branch information
madaraszg-tulip committed Dec 2, 2024
1 parent f803ffc commit 77b1943
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion internal/component/pyroscope/write/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ var (
return Arguments{}
}
_ component.Component = (*Component)(nil)

// List of headers to ignore when copying headers from client to server connection
// https://datatracker.ietf.org/doc/html/rfc9113#name-connection-specific-header-
ignoreProxyHeaders = map[string]bool{
"Connection": true,
"Proxy-Connection": true,
"Keep-Alive": true,
"Transfer-Encoding": true,
"Upgrade": true,
"TE": true,
}
)

func init() {
Expand Down Expand Up @@ -395,7 +406,7 @@ func (f *fanOutClient) AppendIngest(ctx context.Context, profile *pyroscope.Inco
for k, v := range profile.Headers {
// Ignore this header as it may interfere with keepalives in the connection to pyroscope
// which may cause huge load due to tls renegotiation
if k == "Connection" {
if _, exists := ignoreProxyHeaders[k]; exists {
continue
}
req.Header[k] = v
Expand Down

0 comments on commit 77b1943

Please sign in to comment.