aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_rest.erl
diff options
context:
space:
mode:
authorCristian Hancila <[email protected]>2012-10-26 23:54:36 -0400
committerCristian <[email protected]>2012-11-27 15:40:44 -0500
commit4ddacaf6f6566b5814db0a722c8ed17e02c4fc9c (patch)
treea9f3b514c5eb3384a51463dc62fef555f4aef4ef /src/cowboy_rest.erl
parentd3277b08ce81d6180ad68dc91d5edda00c426544 (diff)
downloadcowboy-4ddacaf6f6566b5814db0a722c8ed17e02c4fc9c.tar.gz
cowboy-4ddacaf6f6566b5814db0a722c8ed17e02c4fc9c.tar.bz2
cowboy-4ddacaf6f6566b5814db0a722c8ed17e02c4fc9c.zip
charsets_provided in rest module to return [binary()]
Diffstat (limited to 'src/cowboy_rest.erl')
-rw-r--r--src/cowboy_rest.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl
index 61062ab..ff3d186 100644
--- a/src/cowboy_rest.erl
+++ b/src/cowboy_rest.erl
@@ -40,7 +40,7 @@
language_a :: undefined | binary(),
%% Charset.
- charsets_p = [] :: [{binary(), atom()}],
+ charsets_p = [] :: [binary()],
charset_a :: undefined | binary(),
%% Cached resource calls.
@@ -371,7 +371,7 @@ charsets_provided(Req, State) ->
case AcceptCharset of
undefined ->
set_content_type(Req3, State2#state{
- charset_a=element(1, hd(CP))});
+ charset_a=hd(CP)});
AcceptCharset ->
AcceptCharset2 = prioritize_charsets(AcceptCharset),
choose_charset(Req3, State2, AcceptCharset2)
@@ -401,7 +401,7 @@ choose_charset(Req, State=#state{charsets_p=CP}, [Charset|Tail]) ->
match_charset(Req, State, Accept, [], _Charset) ->
choose_charset(Req, State, Accept);
-match_charset(Req, State, _Accept, [{Provided, _}|_], {Provided, _}) ->
+match_charset(Req, State, _Accept, [Provided|_], {Provided, _}) ->
set_content_type(Req, State#state{charset_a=Provided});
match_charset(Req, State, Accept, [_|Tail], Charset) ->
match_charset(Req, State, Accept, Tail, Charset).