Skip to content

Commit

Permalink
fix: panic on nil headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Moranilt committed Apr 8, 2024
1 parent 350e733 commit f6a5fd8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ func (c *client) Do(ctx context.Context, method Method, url string, body []byte,
return nil, err
}

for _, key := range headers.Keys() {
request.Header.Set(key, headers.Get(key))
if headers != nil {
for _, key := range headers.Keys() {
request.Header.Set(key, headers.Get(key))
}
}

request, cancel := c.setRequestTimeout(request)
Expand Down

0 comments on commit f6a5fd8

Please sign in to comment.