diff options
author | Loïc Hoguin <[email protected]> | 2015-04-10 17:34:26 +0300 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-04-10 17:34:26 +0300 |
commit | f618634bf648124c9562aaf49ee460be9ef71ae7 (patch) | |
tree | a0bd678d5e053358d3662ee626db677ab6033b2e /src/gun_http.erl | |
parent | cff0a87d3cbdcf67a9049cdc2784d459711e2867 (diff) | |
download | gun-f618634bf648124c9562aaf49ee460be9ef71ae7.tar.gz gun-f618634bf648124c9562aaf49ee460be9ef71ae7.tar.bz2 gun-f618634bf648124c9562aaf49ee460be9ef71ae7.zip |
Add headers to gun_ws_upgrade message
Also improves the code and documentation about this message.
It was incorrectly specified that a gun_ws_upgrade message
could be sent on error; instead a gun_response is sent.
Diffstat (limited to 'src/gun_http.erl')
-rw-r--r-- | src/gun_http.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl index 6e65341..67c235f 100644 --- a/src/gun_http.erl +++ b/src/gun_http.erl @@ -452,11 +452,11 @@ ws_validate_extensions(_, _, _, _) -> close. %% @todo Validate protocols. -ws_handshake_protocols(Buffer, State, _Headers, Extensions, _GunProtocols = []) -> +ws_handshake_protocols(Buffer, State, Headers, Extensions, _GunProtocols = []) -> Protocols = [], - ws_handshake_end(Buffer, State, Extensions, Protocols). + ws_handshake_end(Buffer, State, Headers, Extensions, Protocols). -ws_handshake_end(Buffer, #http_state{owner=Owner, socket=Socket, transport=Transport}, Extensions, Protocols) -> +ws_handshake_end(Buffer, #http_state{owner=Owner, socket=Socket, transport=Transport}, Headers, Extensions, Protocols) -> %% Send ourselves the remaining buffer, if any. _ = case Buffer of <<>> -> @@ -465,4 +465,4 @@ ws_handshake_end(Buffer, #http_state{owner=Owner, socket=Socket, transport=Trans {OK, _, _} = Transport:messages(), self() ! {OK, Socket, Buffer} end, - gun_ws:init(Owner, Socket, Transport, Extensions, Protocols). + gun_ws:init(Owner, Socket, Transport, Headers, Extensions, Protocols). |