Skip to content

Introducing Transparent Proxy Builder #851

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

Merged
merged 2 commits into from
Aug 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,13 @@ public Collection<Header> getHeaders( @Nonnull final URI requestUri )
final Collection<Header> allHeaders = new ArrayList<>();

allHeaders.addAll(customHeaders);
allHeaders.addAll(getHeadersFromHeaderProviders(requestUri));
allHeaders
.addAll(
getHeadersFromHeaderProviders(
this,
requestUri,
customHeaderProviders,
headerProvidersFromClassLoading));
allHeaders.addAll(cachedHeadersFromProperties);
if( allHeaders.stream().noneMatch(header -> header.getName().equalsIgnoreCase(HttpHeaders.AUTHORIZATION)) ) {
allHeaders.addAll(getHeadersForAuthType());
Expand All @@ -180,7 +186,11 @@ public Collection<Header> getHeaders( @Nonnull final URI requestUri )
return allHeaders;
}

private List<Header> getHeadersFromHeaderProviders( @Nonnull final URI requestUri )
static List<Header> getHeadersFromHeaderProviders(
@Nonnull final HttpDestination destination,
@Nonnull final URI requestUri,
@Nonnull final List<DestinationHeaderProvider> customHeaderProviders,
@Nonnull final List<DestinationHeaderProvider> headerProvidersFromClassLoading )
{
final List<DestinationHeaderProvider> aggregatedHeaderProviders = new ArrayList<>();
aggregatedHeaderProviders.addAll(customHeaderProviders);
Expand All @@ -189,7 +199,7 @@ private List<Header> getHeadersFromHeaderProviders( @Nonnull final URI requestUr
final String msg = "Found these {} destination header providers: {}";
log.debug(msg, aggregatedHeaderProviders.size(), aggregatedHeaderProviders);

final DestinationRequestContext requestContext = new DestinationRequestContext(this, requestUri);
final DestinationRequestContext requestContext = new DestinationRequestContext(destination, requestUri);

final List<Header> result = new ArrayList<>();
for( final DestinationHeaderProvider headerProvider : aggregatedHeaderProviders ) {
Expand Down
Loading