Skip to content

Add config option to allow preserveAuthorizationOnRedirect? #2178

Open

Description

@jaredstehler

Would it be possible to add a config override to disable the strip-auth feature host check? (i.e. something like preserveAuthorizationOnRedirect?)

Our setup rewrites the httprequest host and port using a bunch of custom routing logic which involves many aspects of the original request (host, path, control headers), and we have some internal endpoints which return 307 redirects to the un-rewritten service domain host (i.e. internal.services.myco). This code relies on the old behavior of 2.12.3, which propagated the authorization header when following the redirect.

Alternatively, if I could configure some mechanism to allow auth propagation on redirects (i.e. Function<org.asynchttpclient.uri.Uri, Boolean>) I could pass in ((uri) -> uri.getHost().endswith(".services.myco"))

I understand this change was put in place to remediate a cve, but in our case these particular httpclients are specially configured as "internal-only".

In the meantime I'm exploring a workaround with a ResponseFilter; will post update with my findings.

Activity

  1. jaredstehler commented on May 13, 2026

    @jaredstehler
    Author

    i was able to get my desired behavior with a custom response filter and

    return new FilterContext.FilterContextBuilder<>(ctx)
            .request(buildRedirectRequest(request, redirectUri, statusCode, redirectCount + 1))
            .replayRequest(true)
            .build();

    this feature request is perhaps too niche to include in the library, since there's a viable workaround.

  2. hyperxpro commented on May 23, 2026

    @hyperxpro
    Member

    Probably a config to disable all safety mechanisms would be nice but it also open doors to potential misconfiguration. I would rather prefer to document this workaround if someone really wants to do it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions