aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--src/cowboy_http_protocol.erl2
2 files changed, 2 insertions, 2 deletions
diff --git a/README.md b/README.md
index 876af0f..153d95c 100644
--- a/README.md
+++ b/README.md
@@ -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.