0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 20:50:24 +00:00

If we have a mapping to '*' then use it as the default catch all accept

This commit is contained in:
Tim Dysinger 2012-02-18 16:00:47 -10:00
parent e7b6e2a402
commit 21cd61cb38

View file

@ -736,7 +736,8 @@ put_resource(Req, State, OnTrue) ->
choose_content_type(Req, State, _OnTrue, _ContentType, []) ->
respond(Req, State, 415);
choose_content_type(Req, State, OnTrue, ContentType,
[{Accepted, Fun}|_Tail]) when ContentType =:= Accepted ->
[{Accepted, Fun}|_Tail])
when Accepted =:= '*' orelse ContentType =:= Accepted ->
case call(Req, State, Fun) of
{halt, Req2, HandlerState} ->
terminate(Req2, State#state{handler_state=HandlerState});