diff options
author | Loïc Hoguin <[email protected]> | 2012-11-28 17:32:01 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2012-11-28 17:32:01 +0100 |
commit | 8cd91832726a3624cfc83f51c073bf2a10c60d63 (patch) | |
tree | 5eca12642fbe4cb96252be3be44cfcda3e059216 /src/cowboy_rest.erl | |
parent | 916bfde1f8fd09483068819c121bb2b698eae8bd (diff) | |
parent | 4ddacaf6f6566b5814db0a722c8ed17e02c4fc9c (diff) | |
download | cowboy-8cd91832726a3624cfc83f51c073bf2a10c60d63.tar.gz cowboy-8cd91832726a3624cfc83f51c073bf2a10c60d63.tar.bz2 cowboy-8cd91832726a3624cfc83f51c073bf2a10c60d63.zip |
Merge branch 'master' of git://github.com/chancila/cowboy
Diffstat (limited to 'src/cowboy_rest.erl')
-rw-r--r-- | src/cowboy_rest.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl index bc14d35..2b1bda5 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. @@ -372,7 +372,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) @@ -402,7 +402,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). |