Add port to Origin HTTP Header if the port is non default (80/443). See
#262
This commit is contained in:
parent
347772a1e9
commit
951c275869
@ -146,6 +146,7 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
|
|||||||
// See http://tools.ietf.org/html/rfc6454#section-6.2
|
// See http://tools.ietf.org/html/rfc6454#section-6.2
|
||||||
originValue = originValue + ":" + wsPort;
|
originValue = originValue + ":" + wsPort;
|
||||||
}
|
}
|
||||||
|
request.addHeader(Names.ORIGIN, originValue);
|
||||||
|
|
||||||
request.addHeader(Names.SEC_WEBSOCKET_KEY1, key1);
|
request.addHeader(Names.SEC_WEBSOCKET_KEY1, key1);
|
||||||
request.addHeader(Names.SEC_WEBSOCKET_KEY2, key2);
|
request.addHeader(Names.SEC_WEBSOCKET_KEY2, key2);
|
||||||
|
@ -130,6 +130,8 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
|
|||||||
// See http://tools.ietf.org/html/rfc6454#section-6.2
|
// See http://tools.ietf.org/html/rfc6454#section-6.2
|
||||||
originValue = originValue + ":" + wsPort;
|
originValue = originValue + ":" + wsPort;
|
||||||
}
|
}
|
||||||
|
request.addHeader(Names.ORIGIN, originValue);
|
||||||
|
|
||||||
|
|
||||||
if (protocol != null && !protocol.equals("")) {
|
if (protocol != null && !protocol.equals("")) {
|
||||||
request.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, protocol);
|
request.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, protocol);
|
||||||
|
@ -130,7 +130,8 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
|
|||||||
// See http://tools.ietf.org/html/rfc6454#section-6.2
|
// See http://tools.ietf.org/html/rfc6454#section-6.2
|
||||||
originValue = originValue + ":" + wsPort;
|
originValue = originValue + ":" + wsPort;
|
||||||
}
|
}
|
||||||
|
request.addHeader(Names.ORIGIN, originValue);
|
||||||
|
|
||||||
if (protocol != null && !protocol.equals("")) {
|
if (protocol != null && !protocol.equals("")) {
|
||||||
request.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, protocol);
|
request.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, protocol);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user