Add port to Origin HTTP Header if the port is non default (80/443). See

#262
This commit is contained in:
norman 2012-04-16 13:26:35 +02:00
parent 0a84ce6f00
commit 00e59da7ba
2 changed files with 4 additions and 0 deletions

View File

@ -146,6 +146,8 @@ 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);

View File

@ -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);