diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy.app.src | 2 | ||||
-rw-r--r-- | src/cowboy_http_rest.erl | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/cowboy.app.src b/src/cowboy.app.src index 544142b..46e5b95 100644 --- a/src/cowboy.app.src +++ b/src/cowboy.app.src @@ -14,7 +14,7 @@ {application, cowboy, [ {description, "Small, fast, modular HTTP server."}, - {vsn, "0.6.0"}, + {vsn, git}, {modules, []}, {registered, [cowboy_clock, cowboy_sup]}, {applications, [ diff --git a/src/cowboy_http_rest.erl b/src/cowboy_http_rest.erl index 7f19c89..a0bcc13 100644 --- a/src/cowboy_http_rest.erl +++ b/src/cowboy_http_rest.erl @@ -367,7 +367,8 @@ charsets_provided(Req, State) -> cowboy_http_req:parse_header('Accept-Charset', Req2), case AcceptCharset of undefined -> - set_content_type(Req3, State2#state{charset_a=hd(CP)}); + set_content_type(Req3, State2#state{ + charset_a=element(1, hd(CP))}); AcceptCharset -> AcceptCharset2 = prioritize_charsets(AcceptCharset), choose_charset(Req3, State2, AcceptCharset2) @@ -397,10 +398,9 @@ 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|_Tail], - {Provided, _Quality}) -> +match_charset(Req, State, _Accept, [{Provided, _}|_], {Provided, _}) -> set_content_type(Req, State#state{charset_a=Provided}); -match_charset(Req, State, Accept, [_Provided|Tail], Charset) -> +match_charset(Req, State, Accept, [_|Tail], Charset) -> match_charset(Req, State, Accept, Tail, Charset). set_content_type(Req=#http_req{meta=Meta}, State=#state{ |