Skip to content

Feature: Add Option to Strip Authorization Header on Redirect #2090

New issue

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

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

Already on ? Sign in to your account

Merged
merged 3 commits into from
May 10, 2025

Conversation

hyperxpro
Copy link
Member

@hyperxpro hyperxpro commented May 10, 2025

Closes #1884

@hyperxprohyperxpro requested a review from Copilot May 10, 2025 21:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new configuration option, isStripAuthorizationOnRedirect(), to control whether the Authorization header is stripped during HTTP redirects. Key changes include new tests to verify default and custom behavior, modifications to the client configuration and builder to include the new option, and updates in the redirect interceptor to apply the header-stripping behavior.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
client/src/test/java/org/asynchttpclient/StripAuthorizationOnRedirectHttpTest.javaAdds tests to validate header propagation and stripping on redirects.
client/src/test/java/org/asynchttpclient/DefaultAsyncHttpClientConfigTest.javaProvides unit test coverage for the new configuration option with default and explicit settings.
client/src/main/java/org/asynchttpclient/netty/handler/intercept/Redirect30xInterceptor.javaUpdates the redirect interceptor to remove the Authorization header based on the new config flag.
client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClientConfig.javaIntroduces a new field and builder method to manage the stripAuthorizationOnRedirect setting.
client/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.javaExtends the client config interface with the new method.

@hyperxprohyperxpro changed the title Add isStripAuthorizationOnRedirect() config option to control Authori… Feature: Add Option to Strip Authorization Header on Redirect May 10, 2025
@hyperxprohyperxpro merged commit fb50dc2 into main May 10, 2025
6 checks passed
@hyperxprohyperxpro deleted the auth-redirect-config branch May 10, 2025 23:30
Sign up for free to join this conversation on . Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Authorization header on redirects?
1 participant
@hyperxpro