Closed reaperhulk closed 8 years ago
Ah, those AuthenticatedHeaders
calls in the requests.go
files were all supposed to be removed in favor of the one in provider_client.go
. Will fix today.
Thanks for the quick response @jrperritt, I look forward to the fix :)
@reaperhulk You can go get -u github.com/rackspace/gophercloud
to get the fix that was just pushed. I'll leave this open until we can confirm that it's been resolved.
Yep, this fixes my issue. A quick grep of the codebase looks like you might have missed one last AuthenticatedHeaders call though: rackspace/objectstorage/v1/cdncontainers/requests.go
quite right: #585
When defining a ReauthFunc (or using the one provided by AllowReauth) the request that actually triggers the reauth never succeeds. For example, if you call Download with an expired token it will do the following:
AuthenticatedHeaders
and then set that as the value ofMoreHeaders
in theRequestOpts
struct.X-Auth-Token
header itself, but then has it overwritten by the value inMoreHeaders
.http.StatusUnauthorized
will be received as a status code and the reauth func will be triggeredTokenID
in the struct.client.Request(method, url, options)
is recursively called... which sets the newX-Auth-Token
properly, but then has it overwritten byMoreHeaders
so the request fails again, triggering another loop.