Browse Source

Parse the x-forwarded-for header as a list of tokens

Loïc Hoguin 12 years ago
parent
commit
67beb4d01d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/cowboy_req.erl

+ 3 - 1
src/cowboy_req.erl

@@ -470,7 +470,9 @@ parse_header(Name, Req, Default)
 		when Name =:= <<"if-modified-since">>;
 			Name =:= <<"if-unmodified-since">> ->
 	parse_header(Name, Req, Default, fun cowboy_http:http_date/1);
-parse_header(Name = <<"sec-websocket-protocol">>, Req, Default) ->
+parse_header(Name, Req, Default)
+		when Name =:= <<"sec-websocket-protocol">>;
+			Name =:= <<"x-forwarded-for">> ->
 	parse_header(Name, Req, Default,
 		fun (Value) ->
 			cowboy_http:nonempty_list(Value, fun cowboy_http:token/2)