Skip to content

Commit

Permalink
fix issue rackspace#621 endless recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
Armstrong Li committed Nov 10, 2017
1 parent e00690e commit 8f029d8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions provider_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,6 @@ func (client *ProviderClient) Request(method, url string, options RequestOpts) (
}
req.Header.Set("Accept", applicationJSON)

for k, v := range client.AuthenticatedHeaders() {
req.Header.Add(k, v)
}

// Set the User-Agent header
req.Header.Set("User-Agent", client.UserAgent.Join())
Expand All @@ -185,6 +182,11 @@ func (client *ProviderClient) Request(method, url string, options RequestOpts) (
}
}

// get latest auth token
for k, v := range client.AuthenticatedHeaders() {
req.Header.Set(k, v)
}

// Set connection parameter to close the connection immediately when we've got the response
req.Close = true

Expand Down

0 comments on commit 8f029d8

Please sign in to comment.