Skip to content

Conversation

@cdw8j
Copy link
Contributor

@cdw8j cdw8j commented Oct 2, 2025

I migrated a project from httpcore4 to httpcore5 just recently and when it didn't work, I had to dive into the httpcore5 sources to understand what was going wrong and that I need to create a custom RequestRouter with LOCAL_AUTHORITY_RESOLVER scheme to get the same behavior as before with httpcore4 just using simple ServerBootstrap methods. It is quite a pain to build the custom RequestRouter in the application itself, especially because this isn't really very well documented.

With this new setAuthorityResolver() method, the legacy behavior can be achieved by calling setAuthorityResolver(RequestRouter.LOCAL_AUTHORITY_RESOLVER) in combination with setCanonicalHostName("localhost") on ServerBootstrap or AsyncServerBootstrap .

@ok2c ok2c merged commit 8ac9256 into apache:master Oct 3, 2025
9 of 10 checks passed
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