Add port to Origin if the port is non default (80/443). (#262)

This commit is contained in:
Trustin Lee 2012-05-30 16:00:40 -07:00
parent 4ff98c359c
commit 367895f660
3 changed files with 3 additions and 0 deletions

View File

@ -147,6 +147,7 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
originValue = originValue + ":" + wsPort;
}
request.addHeader(Names.ORIGIN, originValue);
request.addHeader(Names.SEC_WEBSOCKET_KEY1, key1);
request.addHeader(Names.SEC_WEBSOCKET_KEY2, key2);
if (getExpectedSubprotocol() != null && !getExpectedSubprotocol().equals("")) {

View File

@ -130,6 +130,7 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
// See http://tools.ietf.org/html/rfc6454#section-6.2
originValue = originValue + ":" + wsPort;
}
request.addHeader(Names.ORIGIN, originValue);
if (protocol != null && !protocol.equals("")) {
request.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, protocol);

View File

@ -130,6 +130,7 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
// See http://tools.ietf.org/html/rfc6454#section-6.2
originValue = originValue + ":" + wsPort;
}
request.addHeader(Names.ORIGIN, originValue);
if (protocol != null && !protocol.equals("")) {
request.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, protocol);