Browse Source

Use cow_http_hd:parse_transfer_encoding/1 where applicable

Loïc Hoguin 11 years ago
parent
commit
dbf7b1c5e5
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/cowboy_req.erl

+ 4 - 4
src/cowboy_req.erl

@@ -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, Req, Default)
-		when Name =:= <<"transfer-encoding">>;
-			Name =:= <<"upgrade">> ->
+parse_header(Name = <<"transfer-encoding">>, Req, Default) ->
+	parse_header(Name, Req, Default, fun cow_http_hd:parse_transfer_encoding/1);
+%% @todo Product version.
+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)