Skip to content

Commit

Permalink
Removes Sec-WebSocket-Origin From Websocket HS
Browse files Browse the repository at this point in the history
Sec-WebSocket-Origin is a Server to Client handshake not a Client to Server handshake header per the websocket RFC specification. This Resolves Issue netty#9134
  • Loading branch information
davydotcom committed May 8, 2019
1 parent a74fead commit 536376a
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -151,7 +151,6 @@ public WebSocketClientHandshaker13(URI webSocketURL, WebSocketVersion version, S
* Upgrade: websocket
* Connection: Upgrade
* Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
* Sec-WebSocket-Origin: http://example.com
* Sec-WebSocket-Protocol: chat, superchat
* Sec-WebSocket-Version: 13
* </pre>
Expand Down Expand Up @@ -188,8 +187,7 @@ protected FullHttpRequest newHandshakeRequest() {
headers.set(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET)
.set(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE)
.set(HttpHeaderNames.SEC_WEBSOCKET_KEY, key)
.set(HttpHeaderNames.HOST, websocketHostValue(wsURL))
.set(HttpHeaderNames.SEC_WEBSOCKET_ORIGIN, websocketOriginValue(wsURL));
.set(HttpHeaderNames.HOST, websocketHostValue(wsURL));

String expectedSubprotocol = expectedSubprotocol();
if (expectedSubprotocol != null && !expectedSubprotocol.isEmpty()) {
Expand Down

0 comments on commit 536376a

Please sign in to comment.