aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_router.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cowboy_router.erl')
-rw-r--r--src/cowboy_router.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cowboy_router.erl b/src/cowboy_router.erl
index 3b71205..2e54151 100644
--- a/src/cowboy_router.erl
+++ b/src/cowboy_router.erl
@@ -157,7 +157,7 @@ compile_brackets_split(<< C, Rest/binary >>, Acc, N) ->
compile_brackets_split(Rest, << Acc/binary, C >>, N).
-spec execute(Req, Env)
- -> {ok, Req, Env} | {error, 400 | 404, Req}
+ -> {ok, Req, Env} | {halt, Req}
when Req::cowboy_req:req(), Env::cowboy_middleware:env().
execute(Req, Env) ->
{_, Dispatch} = lists:keyfind(dispatch, 1, Env),
@@ -168,11 +168,11 @@ execute(Req, Env) ->
Req2 = cowboy_req:set_bindings(HostInfo, PathInfo, Bindings, Req),
{ok, Req2, [{handler, Handler}, {handler_opts, HandlerOpts}|Env]};
{error, notfound, host} ->
- {error, 400, Req};
+ {halt, cowboy_req:reply(400, Req)};
{error, badrequest, path} ->
- {error, 400, Req};
+ {halt, cowboy_req:reply(400, Req)};
{error, notfound, path} ->
- {error, 404, Req}
+ {halt, cowboy_req:reply(404, Req)}
end.
%% Internal.