PrepareClientHeaders returns a copy of the client headers with hop-by-hop, transport, and auth headers removed.
(clientHeaders http.Header)
| 39 | // PrepareClientHeaders returns a copy of the client headers with hop-by-hop, |
| 40 | // transport, and auth headers removed. |
| 41 | func 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 |
no outgoing calls