Validate validates the Headers config.
()
| 71 | |
| 72 | // Validate validates the Headers config. |
| 73 | func (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. |
| 83 | type Header struct { |
no outgoing calls