MCPcopy
hub / github.com/connectrpc/connect-go / getHeaderCanonical

Function getHeaderCanonical

header.go:105–114  ·  view source on GitHub ↗

getHeaderCanonical is a shortcut for Header.Get() which bypasses the CanonicalMIMEHeaderKey operation when we know the key is already in canonical form.

(h http.Header, key string)

Source from the content-addressed store, hash-verified

103// bypasses the CanonicalMIMEHeaderKey operation when we
104// know the key is already in canonical form.
105func getHeaderCanonical(h http.Header, key string) string {
106 if h == nil {
107 return ""
108 }
109 v := h[key]
110 if len(v) == 0 {
111 return ""
112 }
113 return v[0]
114}
115
116// setHeaderCanonical is a shortcut for Header.Set() which
117// bypasses the CanonicalMIMEHeaderKey operation when we

Callers 15

SetTimeoutMethod · 0.85
NewConnMethod · 0.85
WriteRequestHeaderMethod · 0.85
validateResponseMethod · 0.85
grpcValidateResponseFunction · 0.85
grpcErrorForTrailerFunction · 0.85
ServeHTTPMethod · 0.85
SetTimeoutMethod · 0.85
NewConnMethod · 0.85
WriteRequestHeaderMethod · 0.85
validateResponseMethod · 0.85
validateResponseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected