Skip to content

Commit

Permalink
headers
Browse files Browse the repository at this point in the history
  • Loading branch information
VinnyHC committed Mar 14, 2022
1 parent 3a2e9c5 commit b94c8d8
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions api/client.go
Expand Up @@ -1261,8 +1261,14 @@ func (c *Client) httpRequestWithContext(ctx context.Context, r *Request) (*Respo
limiter := c.config.Limiter
httpClient := c.config.HttpClient
outputCurlString := c.config.OutputCurlString
if c.headers != nil {
for header, vals := range c.headers {
for _, val := range vals {
req.Header.Add(header, val)
}
}
}
c.config.modifyLock.RUnlock()

c.modifyLock.RUnlock()

// OutputCurlString logic relies on the request type to be retryable.Request as
Expand All @@ -1275,14 +1281,6 @@ func (c *Client) httpRequestWithContext(ctx context.Context, r *Request) (*Respo
req.URL.Host = r.URL.Host
req.Host = r.URL.Host

if r.Headers != nil {
for header, vals := range r.Headers {
for _, val := range vals {
req.Header.Add(header, val)
}
}
}

if len(r.ClientToken) != 0 {
req.Header.Set(consts.AuthHeaderName, r.ClientToken)
}
Expand Down

0 comments on commit b94c8d8

Please sign in to comment.