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:23:58 +02:00
parent 347772a1e9
commit 951c275869
3 changed files with 5 additions and 1 deletions

View File

@ -146,6 +146,7 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
// See http://tools.ietf.org/html/rfc6454#section-6.2
originValue = originValue + ":" + wsPort;
}
request.addHeader(Names.ORIGIN, originValue);
request.addHeader(Names.SEC_WEBSOCKET_KEY1, key1);
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
originValue = originValue + ":" + wsPort;
}
request.addHeader(Names.ORIGIN, originValue);
if (protocol != null && !protocol.equals("")) {
request.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, protocol);

View File

@ -130,7 +130,8 @@ 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);
}