-
Notifications
You must be signed in to change notification settings - Fork 583
OpenStack V2 Authentication Failed since RequestOpts.MoreHeaders does not make sense #2314
Copy link
Copy link
Closed
Description
In provider_client.go:322, RequestOpts.Header says it will be omitted if it is a blank value.
// RequestOpts customizes the behavior of the provider.Request() method.
type RequestOpts struct {
// MoreHeaders specifies additional HTTP headers to be provide on the request. If a header is
// provided with a blank value (""), that header will be *omitted* instead: use this to suppress
// the default Accept header or an inferred Content-Type, for example.
MoreHeaders map[string]string
}
But in commit 29581a2 [Swift V1: fix setting empty headers (#2218)], the method locate in provider_client.go:411 has been changed, and blank header no longer been removed.
This caused an Authentication Failed error when trying to get an v2auth client due to an empty X-Auth-Token header.
This symptom is imported after v0.21.0.
openstack/identity/v2/tokens/requests.go:94:
resp, err := client.Post(CreateURL(client), b, &r.Body, &gophercloud.RequestOpts{
OkCodes: []int{200, 203},
MoreHeaders: map[string]string{"X-Auth-Token": ""},
})
How can I make it correct? Is there any suggestion or work around?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels