Browse Source

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

Tim Dysinger 13 years ago
parent
commit
21cd61cb38
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/cowboy_http_rest.erl

+ 2 - 1
src/cowboy_http_rest.erl

@@ -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});