aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_ws.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-10-21 19:15:48 +0200
committerLoïc Hoguin <[email protected]>2020-10-21 20:17:18 +0200
commit465d072abf4a76104d4562ed15345b27fe9a0cff (patch)
tree853338dc133fda51ed65e74dedc81f845dc090de /src/gun_ws.erl
parent69f19635df64ea48af3120c9685f7ad51b338f8f (diff)
downloadgun-465d072abf4a76104d4562ed15345b27fe9a0cff.tar.gz
gun-465d072abf4a76104d4562ed15345b27fe9a0cff.tar.bz2
gun-465d072abf4a76104d4562ed15345b27fe9a0cff.zip
Fix cookie handling when tunnel and origin schemes mismatch
The cookie_ignore_informational has been moved to http_opts and http2_opts. Also fix an issue when using 'protocols' in gun:open. When connecting via TLS the protocol's options were discarded.
Diffstat (limited to 'src/gun_ws.erl')
-rw-r--r--src/gun_ws.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gun_ws.erl b/src/gun_ws.erl
index cd81d65..f413f94 100644
--- a/src/gun_ws.erl
+++ b/src/gun_ws.erl
@@ -20,7 +20,7 @@
-export([has_keepalive/0]).
-export([default_keepalive/0]).
-export([init/4]).
--export([handle/4]).
+-export([handle/5]).
-export([update_flow/4]).
-export([closing/4]).
-export([close/4]).
@@ -101,6 +101,10 @@ init(ReplyTo, Socket, Transport, #{stream_ref := StreamRef, headers := Headers,
socket=Socket, transport=Transport, opts=Opts, extensions=Extensions,
flow=InitialFlow, handler=Handler, handler_state=HandlerState}}.
+handle(Data, State, CookieStore, EvHandler, EvHandlerState0) ->
+ {Commands, EvHandlerState} = handle(Data, State, EvHandler, EvHandlerState0),
+ {Commands, CookieStore, EvHandlerState}.
+
%% Do not handle anything if we received a close frame.
%% Initiate or terminate the closing state depending on whether we sent a close yet.
handle(_, State=#ws_state{in=close, out=close}, _, EvHandlerState) ->