Skip to content

fix: Prevent double entries of Authorization header on second authenticate call#150

Merged
padamstx merged 1 commit intoIBM:mainfrom
eiri:fix-double-authorization-header
Oct 5, 2021
Merged

fix: Prevent double entries of Authorization header on second authenticate call#150
padamstx merged 1 commit intoIBM:mainfrom
eiri:fix-double-authorization-header

Conversation

@eiri
Copy link
Copy Markdown
Contributor

@eiri eiri commented Oct 5, 2021

When authenticate method called by BasicAuthenticator, BearerTokenAuthenticator or TokenRequestBasedAuthenticator second time on the same request it adds second Authorization header to the request. This can lead to a consecutive failure with 400 error from the services with strict rules about headers' double entries.

This PR switches named authenticators to use builder.header method to prevent that.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 5, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@padamstx padamstx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good!

@padamstx padamstx merged commit 88601fa into IBM:main Oct 5, 2021
ibm-devx-sdk pushed a commit that referenced this pull request Oct 5, 2021
## [9.13.3](9.13.2...9.13.3) (2021-10-05)

### Bug Fixes

* ensure single-valued Authorization header ([#150](#150)) ([88601fa](88601fa))
@ibm-devx-sdk
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 9.13.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants