[#729] Correctly handle urls with empty abs_path in it when issue the websocket handshake
This commit is contained in:
parent
105f952f5d
commit
2d5028bfd6
@ -137,6 +137,10 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
|
||||
path = wsURL.getPath() + '?' + wsURL.getQuery();
|
||||
}
|
||||
|
||||
if (path == null || path.isEmpty()) {
|
||||
path = "/";
|
||||
}
|
||||
|
||||
// Format request
|
||||
HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, path);
|
||||
request.addHeader(Names.UPGRADE, Values.WEBSOCKET);
|
||||
|
@ -105,6 +105,10 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
|
||||
path = wsURL.getPath() + '?' + wsURL.getQuery();
|
||||
}
|
||||
|
||||
if (path == null || path.isEmpty()) {
|
||||
path = "/";
|
||||
}
|
||||
|
||||
// Get 16 bit nonce and base 64 encode it
|
||||
byte[] nonce = WebSocketUtil.randomBytes(16);
|
||||
String key = WebSocketUtil.base64(nonce);
|
||||
|
@ -105,6 +105,10 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
|
||||
path = wsURL.getPath() + '?' + wsURL.getQuery();
|
||||
}
|
||||
|
||||
if (path == null || path.isEmpty()) {
|
||||
path = "/";
|
||||
}
|
||||
|
||||
// Get 16 bit nonce and base 64 encode it
|
||||
byte[] nonce = WebSocketUtil.randomBytes(16);
|
||||
String key = WebSocketUtil.base64(nonce);
|
||||
|
Loading…
Reference in New Issue
Block a user