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

NettyConnector - HOST header contains port & 307 works with buffered post #5800

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

jansupol
Copy link
Contributor

Host header contains port for non 80 & 443 ports
Status 307 with post and buffered entity does not hang

@senivam senivam merged commit b231664 into eclipse-ee4j:2.x Nov 14, 2024
7 checks passed
@senivam senivam added this to the 2.46 milestone Nov 14, 2024
Copy link

@sxsubram sxsubram left a comment

Choose a reason for hiding this comment

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

jerseyRequest.setStreamProvider(new OutboundMessageContext.StreamProvider() {
@OverRide
public OutputStream getOutputStream(int contentLength) throws IOException {
replaceHeaders(jerseyRequest, nettyRequest.headers()); // WriterInterceptor changes
if (!nettyRequest.headers().contains(HttpHeaderNames.HOST)) {
nettyRequest.headers().add(HttpHeaderNames.HOST, jerseyRequest.getUri().getHost());
}
headersSet.countDown();

                    return entityWriter.getOutputStream();
                }
            });

port needs to be added here as well.

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.

jersey-netty-connector: non standard port not added to Host: header when sending requests
4 participants