mergeNonProtocolHeaders merges headers excluding protocol headers defined in protocolHeaders.
(into, from http.Header)
| 86 | // mergeNonProtocolHeaders merges headers excluding protocol headers defined in |
| 87 | // protocolHeaders. |
| 88 | func mergeNonProtocolHeaders(into, from http.Header) { |
| 89 | for key, vals := range from { |
| 90 | if len(vals) == 0 { |
| 91 | // For response trailers, net/http will pre-populate entries |
| 92 | // with nil values based on the "Trailer" header. But if there |
| 93 | // are no actual values for those keys, we skip them. |
| 94 | continue |
| 95 | } |
| 96 | if _, isProtocolHeader := protocolHeaders[key]; !isProtocolHeader { |
| 97 | into[key] = append(into[key], vals...) |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | // getHeaderCanonical is a shortcut for Header.Get() which |
| 103 | // bypasses the CanonicalMIMEHeaderKey operation when we |
no outgoing calls
no test coverage detected