Only override headers if they're set

This commit is contained in:
Conor Mongey 2021-01-05 16:09:55 +00:00
parent e4b4c31d28
commit e2a2ebeb9e
No known key found for this signature in database
GPG Key ID: 5C886ACC44EB17C0
1 changed files with 3 additions and 2 deletions

View File

@ -858,8 +858,9 @@ func (c *Client) newRequest(method, path string) *request {
header: make(http.Header),
}
r.header = c.config.Header
if c.config.Header != nil {
r.header = c.config.Header
}
if c.config.Datacenter != "" {
r.params.Set("dc", c.config.Datacenter)
}