diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | src/cowboy_http_protocol.erl | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -66,7 +66,7 @@ handler could be written like this: -export([init/2, handle/2]). init(Req, Opts) -> - {ok, undefined}. + {ok, Req, undefined}. handle(Req, State) -> {reply, 200, [], "Hello World!"}. diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl index da10411..594699d 100644 --- a/src/cowboy_http_protocol.erl +++ b/src/cowboy_http_protocol.erl @@ -111,7 +111,7 @@ header(http_eoh, Req, State) -> -spec handler_init(Req::#http_req{}, State::#state{}) -> ok. handler_init(Req, State=#state{handler={Handler, Opts}}) -> case Handler:init(Req, Opts) of - {ok, HandlerState} -> + {ok, Req, HandlerState} -> handler_loop(HandlerState, Req, State) %% @todo {mode, active}; {upgrade_protocol, Module}; {error, Reason} end. |