diff --git a/api/api.go b/api/api.go index f0d4022b8..0efb10bbb 100644 --- a/api/api.go +++ b/api/api.go @@ -156,7 +156,7 @@ type Config struct { // TLSConfig is ignored if HttpClient is set. TLSConfig *TLSConfig - Headers map[string]string + Headers http.Header } // ClientConfig copies the configuration with a new client address, region, and @@ -676,9 +676,7 @@ func (c *Client) newRequest(method, path string) (*request, error) { } } - for key, value := range c.config.Headers { - r.header.Set(key, value) - } + r.header = c.config.Headers return r, nil } diff --git a/api/api_test.go b/api/api_test.go index e2dcd6321..0048ecdfe 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -344,8 +344,8 @@ func TestParseWriteMeta(t *testing.T) { func TestClientHeader(t *testing.T) { t.Parallel() c, s := makeClient(t, func(c *Config) { - c.Headers = map[string]string{ - "Hello": "World", + c.Headers = http.Header{ + "Hello": []string{"World"}, } }, nil) defer s.Stop()