Skip to content

Commit 48c1186

Browse files
committed
Merge pull request #38 from danielwhite/remove-origin-header
Do not send 'Origin' header in handshake
2 parents 2b8d980 + 0ceafb1 commit 48c1186

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/websocket_client.erl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,11 @@ ws_client_init(Handler, Protocol, Host, Port, Path, Args, Opts) ->
122122
%% @doc Send http upgrade request and validate handshake response challenge
123123
-spec websocket_handshake(WSReq :: websocket_req:req(), [{string(), string()}]) -> {ok, binary()} | {error, term()}.
124124
websocket_handshake(WSReq, ExtraHeaders) ->
125-
[Protocol, Path, Host, Key, Transport, Socket] =
126-
websocket_req:get([protocol, path, host, key, transport, socket], WSReq),
125+
[Path, Host, Key, Transport, Socket] =
126+
websocket_req:get([path, host, key, transport, socket], WSReq),
127127
Handshake = ["GET ", Path, " HTTP/1.1\r\n"
128128
"Host: ", Host, "\r\n"
129129
"Connection: Upgrade\r\n"
130-
"Origin: ", atom_to_binary(Protocol, utf8), "://", Host, "\r\n"
131130
"Sec-WebSocket-Version: 13\r\n"
132131
"Sec-WebSocket-Key: ", Key, "\r\n"
133132
"Upgrade: websocket\r\n",

0 commit comments

Comments
 (0)