Skip to content

Commit

Permalink
If we have a mapping to '*' then use it as the default catch all accept
Browse files Browse the repository at this point in the history
  • Loading branch information
dysinger committed Mar 8, 2012
1 parent e7b6e2a commit 21cd61c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cowboy_http_rest.erl
Expand Up @@ -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});
Expand Down

0 comments on commit 21cd61c

Please sign in to comment.