Skip to content

Conversation

@jansupol
Copy link
Contributor

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

…post

Signed-off-by: jansupol <jan.supol@oracle.com>
@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.

@jansupol jansupol deleted the netty.port.buffered.redirect branch November 14, 2024 21:38
@jansupol
Copy link
Contributor Author

@sxsubram nice catch! Fixed by #5801

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