MCPcopy
hub / github.com/grafana/dskit / ToHeader

Function ToHeader

httpgrpc/httpgrpc.go:90–96  ·  view source on GitHub ↗
(hs []*Header, header http.Header)

Source from the content-addressed store, hash-verified

88}
89
90func ToHeader(hs []*Header, header http.Header) {
91 for _, h := range hs {
92 // http.Header expects header to be stored in canonical form,
93 // otherwise they are inaccessible with Get() on a http.Header struct.
94 header[http.CanonicalHeaderKey(h.Key)] = h.Values
95 }
96}
97
98func FromHeader(hs http.Header) []*Header {
99 result := make([]*Header, 0, len(hs))

Callers 3

TestToHeaderFunction · 0.85
ToHTTPRequestFunction · 0.85
WriteResponseFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestToHeaderFunction · 0.68