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.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cowboy_router.erl b/src/cowboy_router.erl
index 2d1924d..b806da5 100644
--- a/src/cowboy_router.erl
+++ b/src/cowboy_router.erl
@@ -157,7 +157,7 @@ compile_brackets_split(<< C, Rest/bits >>, Acc, N) ->
compile_brackets_split(Rest, << Acc/binary, C >>, N).
-spec execute(Req, Env)
- -> {ok, Req, Env} | {halt, Req}
+ -> {ok, Req, Env} | {stop, 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} ->
- {halt, cowboy_req:reply(400, Req)};
+ {stop, cowboy_req:reply(400, Req)};
{error, badrequest, path} ->
- {halt, cowboy_req:reply(400, Req)};
+ {stop, cowboy_req:reply(400, Req)};
{error, notfound, path} ->
- {halt, cowboy_req:reply(404, Req)}
+ {stop, cowboy_req:reply(404, Req)}
end.
%% Internal.
@@ -425,6 +425,8 @@ split_host_test_() ->
[<<"eu">>, <<"ninenines">>, <<"cowboy">>]},
{<<"ninenines.eu">>,
[<<"eu">>, <<"ninenines">>]},
+ {<<"ninenines.eu.">>,
+ [<<"eu">>, <<"ninenines">>]},
{<<"a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z">>,
[<<"z">>, <<"y">>, <<"x">>, <<"w">>, <<"v">>, <<"u">>, <<"t">>,
<<"s">>, <<"r">>, <<"q">>, <<"p">>, <<"o">>, <<"n">>, <<"m">>,