Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prioritize request-level Authorization in headers merging #6638

Open
wants to merge 2 commits into
base: v1.x
Choose a base branch
from

Conversation

BrijeshPatra
Copy link

This PR modifies the mergeConfig function's headers merging logic to ensure that request-level Authorization headers take precedence over instance-level Authorization headers. This change is crucial in scenarios where multiple configurations may set Authorization, ensuring that the most specific (request-level) value is utilized.

Changes Made:

-Updated the headers merging logic to prioritize the Authorization header from config2 over config1.
Ensured that the merging of headers retains other properties as before.

Testing:

Added unit tests to cover the new merging behavior for the Authorization header.
All tests have been run and passed successfully.

@BrijeshPatra
Copy link
Author

This change is intended to resolve issues where the Authorization header from the request configuration was being overridden by the instance-level configuration. This adjustment ensures that request-level configurations take precedence, improving flexibility in how authorization is handled.

I’ve added unit tests to ensure that the new behavior works as intended, covering various scenarios for merging headers.

Please let me know if you have any questions or if there are additional scenarios you think should be covered in the tests.

@karloluis
Copy link

Addresses #6587

@karloluis
Copy link

@BrijeshPatra You might have forgotten to push your commit with the unit test. No such file appears in the PR from what I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants