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

Method Validate

config/headers.go:73–80  ·  view source on GitHub ↗

Validate validates the Headers config.

()

Source from the content-addressed store, hash-verified

71
72// Validate validates the Headers config.
73func (h *Headers) Validate() error {
74 for n := range h.Headers {
75 if _, ok := ReservedHeaders[http.CanonicalHeaderKey(n)]; ok {
76 return fmt.Errorf("setting header %q is not allowed", http.CanonicalHeaderKey(n))
77 }
78 }
79 return nil
80}
81
82// Header represents the configuration for a single HTTP header.
83type Header struct {

Callers 2

TestNewClientFromConfigFunction · 0.45
TestValidateHTTPConfigFunction · 0.45

Calls

no outgoing calls

Tested by 2

TestNewClientFromConfigFunction · 0.36
TestValidateHTTPConfigFunction · 0.36