Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

fix issue #621 endless recursion #622

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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