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

Use cow_http_hd:parse_transfer_encoding/1 where applicable

This commit is contained in:
Loïc Hoguin 2014-03-24 14:11:40 +01:00
parent dff1b5715c
commit dbf7b1c5e5

View file

@ -454,10 +454,10 @@ parse_header(Name, Req, Default)
fun (Value) -> fun (Value) ->
cowboy_http:nonempty_list(Value, fun cowboy_http:token/2) cowboy_http:nonempty_list(Value, fun cowboy_http:token/2)
end); end);
%% @todo Extension parameters. parse_header(Name = <<"transfer-encoding">>, Req, Default) ->
parse_header(Name, Req, Default) parse_header(Name, Req, Default, fun cow_http_hd:parse_transfer_encoding/1);
when Name =:= <<"transfer-encoding">>; %% @todo Product version.
Name =:= <<"upgrade">> -> parse_header(Name = <<"upgrade">>, Req, Default) ->
parse_header(Name, Req, Default, parse_header(Name, Req, Default,
fun (Value) -> fun (Value) ->
cowboy_http:nonempty_list(Value, fun cowboy_http:token_ci/2) cowboy_http:nonempty_list(Value, fun cowboy_http:token_ci/2)