MCPcopy Index your code
hub / github.com/coder/coder / PrepareClientHeaders

Function PrepareClientHeaders

aibridge/intercept/client_headers.go:52–67  ·  view source on GitHub ↗

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

(clientHeaders http.Header)

Source from the content-addressed store, hash-verified

50// PrepareClientHeaders returns a copy of the client headers with hop-by-hop,
51// transport, auth, and proxy headers removed.
52func PrepareClientHeaders(clientHeaders http.Header) http.Header {
53 prepared := clientHeaders.Clone()
54 for _, h := range hopByHopHeaders {
55 prepared.Del(h)
56 }
57 for _, h := range nonForwardedHeaders {
58 prepared.Del(h)
59 }
60 for _, h := range authHeaders {
61 prepared.Del(h)
62 }
63 for _, h := range proxyHeaders {
64 prepared.Del(h)
65 }
66 return prepared
67}
68
69// BuildUpstreamHeaders produces the header set for an upstream SDK request.
70// It starts from the prepared client headers, then preserves specific

Callers 2

TestPrepareClientHeadersFunction · 0.92
BuildUpstreamHeadersFunction · 0.85

Calls 1

CloneMethod · 0.45

Tested by 1

TestPrepareClientHeadersFunction · 0.74