[#1558] Corrects handling of port number in WebSockets handshake header values
* This patch was inspired by the work of @golovnin
This commit is contained in:
parent
daa79f3a11
commit
2380461861
@ -116,6 +116,16 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
|
||||
|
||||
// Format request
|
||||
int wsPort = wsURL.getPort();
|
||||
// check if the URI contained a port if not set the correct one depending on the schema.
|
||||
// See https://github.com/netty/netty/pull/1558
|
||||
if (wsPort == -1) {
|
||||
if ("https".equals(wsURL.getScheme())) {
|
||||
wsPort = 443;
|
||||
} else {
|
||||
wsPort = 80;
|
||||
}
|
||||
}
|
||||
|
||||
FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, path);
|
||||
HttpHeaders headers = request.headers();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user