diff --git a/config/headers.go b/config/headers.go index 4a0be4a1..81cd8aad 100644 --- a/config/headers.go +++ b/config/headers.go @@ -78,17 +78,10 @@ func (h *Headers) SetDirectory(dir string) { // Validate validates the Headers config. func (h *Headers) Validate() error { - for n, header := range h.Headers { + for n := range h.Headers { if _, ok := reservedHeaders[http.CanonicalHeaderKey(n)]; ok { return fmt.Errorf("setting header %q is not allowed", http.CanonicalHeaderKey(n)) } - for _, v := range header.Files { - f := JoinDir(h.dir, v) - _, err := os.ReadFile(f) - if err != nil { - return fmt.Errorf("unable to read header %q from file %s: %w", http.CanonicalHeaderKey(n), f, err) - } - } } return nil } diff --git a/config/http_config.go b/config/http_config.go index 228db63e..b640b899 100644 --- a/config/http_config.go +++ b/config/http_config.go @@ -828,7 +828,7 @@ type basicAuthRoundTripper struct { // NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a request unless it has // already been set. -func NewBasicAuthRoundTripper(username SecretReader, password SecretReader, rt http.RoundTripper) http.RoundTripper { +func NewBasicAuthRoundTripper(username, password SecretReader, rt http.RoundTripper) http.RoundTripper { return &basicAuthRoundTripper{username, password, rt} } diff --git a/config/http_config_test.go b/config/http_config_test.go index 9236f7cb..77382328 100644 --- a/config/http_config_test.go +++ b/config/http_config_test.go @@ -1107,7 +1107,7 @@ func getCertificateBlobs(t *testing.T) map[string][]byte { return bs } -func writeCertificate(bs map[string][]byte, src string, dst string) { +func writeCertificate(bs map[string][]byte, src, dst string) { b, ok := bs[src] if !ok { panic(fmt.Sprintf("Couldn't find %q in bs", src))