MCPcopy Create free account
hub / github.com/coder/aibridge / PrepareClientHeaders

Function PrepareClientHeaders

intercept/client_headers.go:41–53  ·  view source on GitHub ↗

PrepareClientHeaders returns a copy of the client headers with hop-by-hop, transport, and auth headers removed.

(clientHeaders http.Header)

Source from the content-addressed store, hash-verified

39// PrepareClientHeaders returns a copy of the client headers with hop-by-hop,
40// transport, and auth headers removed.
41func PrepareClientHeaders(clientHeaders http.Header) http.Header {
42 prepared := clientHeaders.Clone()
43 for _, h := range hopByHopHeaders {
44 prepared.Del(h)
45 }
46 for _, h := range nonForwardedHeaders {
47 prepared.Del(h)
48 }
49 for _, h := range authHeaders {
50 prepared.Del(h)
51 }
52 return prepared
53}
54
55// BuildUpstreamHeaders produces the header set for an upstream SDK request.
56// It starts from the prepared client headers, then preserves specific

Callers 2

TestPrepareClientHeadersFunction · 0.92
BuildUpstreamHeadersFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestPrepareClientHeadersFunction · 0.74