aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_handler.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-01-02 16:47:16 +0100
committerLoïc Hoguin <[email protected]>2017-01-02 16:47:16 +0100
commite10daf39fa08fb1367b277b31b4c9c9baad5239b (patch)
tree348ed3084f217ede4b05f722b81e536f9180f5a2 /src/cowboy_handler.erl
parented664345d7c65922269bd89d70babffc97d9e095 (diff)
downloadcowboy-e10daf39fa08fb1367b277b31b4c9c9baad5239b.tar.gz
cowboy-e10daf39fa08fb1367b277b31b4c9c9baad5239b.tar.bz2
cowboy-e10daf39fa08fb1367b277b31b4c9c9baad5239b.zip
Numerous Dialyzer fixes
Diffstat (limited to 'src/cowboy_handler.erl')
-rw-r--r--src/cowboy_handler.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cowboy_handler.erl b/src/cowboy_handler.erl
index af21342..4dbe226 100644
--- a/src/cowboy_handler.erl
+++ b/src/cowboy_handler.erl
@@ -39,7 +39,7 @@ execute(Req, Env=#{handler := Handler, handler_opts := HandlerOpts}) ->
try Handler:init(Req, HandlerOpts) of
{ok, Req2, State} ->
Result = terminate(normal, Req2, State, Handler),
- {ok, Req2, [{result, Result}|Env]};
+ {ok, Req2, Env#{result => Result}};
{Mod, Req2, State} ->
Mod:upgrade(Req2, Env, Handler, State, infinity, run);
{Mod, Req2, State, hibernate} ->
@@ -53,7 +53,7 @@ execute(Req, Env=#{handler := Handler, handler_opts := HandlerOpts}) ->
erlang:raise(Class, Reason, erlang:get_stacktrace())
end.
--spec terminate(any(), Req, any(), module()) -> ok when Req::cowboy_req:req().
+-spec terminate(any(), Req | undefined, any(), module()) -> ok when Req::cowboy_req:req().
terminate(Reason, Req, State, Handler) ->
case erlang:function_exported(Handler, terminate, 3) of
true ->