0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00

The charset iso-8859-1 is added only if not explicitely mentioned

It was added all the time when * was missing, the RFC specifies it
should only be added if it wasn't already present, though.
This commit is contained in:
Loïc Hoguin 2013-05-16 17:38:29 +02:00
parent 08fcb38a18
commit 2e787fed56

View file

@ -426,7 +426,11 @@ prioritize_charsets(AcceptCharsets) ->
end, AcceptCharsets),
case lists:keymember(<<"*">>, 1, AcceptCharsets2) of
true -> AcceptCharsets2;
false -> [{<<"iso-8859-1">>, 1000}|AcceptCharsets2]
false ->
case lists:keymember(<<"iso-8859-1">>, 1, AcceptCharsets2) of
true -> AcceptCharsets2;
false -> [{<<"iso-8859-1">>, 1000}|AcceptCharsets2]
end
end.
choose_charset(Req, State, []) ->