aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_rest.erl
diff options
context:
space:
mode:
authorTim Dysinger <[email protected]>2012-02-18 16:00:47 -1000
committerTim Dysinger <[email protected]>2012-03-08 03:17:55 -1000
commit21cd61cb388fe1037a618fcd4a2f7918e6b4c112 (patch)
tree9ee83ee900bd509ce477c7d7ebbfa926e2345e90 /src/cowboy_http_rest.erl
parente7b6e2a402922724ffd668161ed1b65533b5c034 (diff)
downloadcowboy-21cd61cb388fe1037a618fcd4a2f7918e6b4c112.tar.gz
cowboy-21cd61cb388fe1037a618fcd4a2f7918e6b4c112.tar.bz2
cowboy-21cd61cb388fe1037a618fcd4a2f7918e6b4c112.zip
If we have a mapping to '*' then use it as the default catch all accept
Diffstat (limited to 'src/cowboy_http_rest.erl')
-rw-r--r--src/cowboy_http_rest.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cowboy_http_rest.erl b/src/cowboy_http_rest.erl
index 392b172..589183d 100644
--- a/src/cowboy_http_rest.erl
+++ b/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});