MCPcopy Create free account
hub / github.com/prometheus/common / HTTPHeader

Method HTTPHeader

config/config.go:54–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52type Header map[string][]Secret
53
54func (h *Header) HTTPHeader() http.Header {
55 if h == nil || *h == nil {
56 return nil
57 }
58
59 header := make(http.Header)
60
61 for name, values := range *h {
62 var s []string
63 if values != nil {
64 s = make([]string, 0, len(values))
65 for _, value := range values {
66 s = append(s, string(value))
67 }
68 }
69 header[name] = s
70 }
71
72 return header
73}
74
75// DirectorySetter is a config type that contains file paths that may
76// be relative to the file containing the config.

Callers 2

TestHeaderHTTPHeaderFunction · 0.80
GetProxyConnectHeaderMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestHeaderHTTPHeaderFunction · 0.64