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

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

This commit is contained in:
Loïc Hoguin 2013-04-11 14:38:19 +02:00
parent be94cb12aa
commit 67beb4d01d

View file

@ -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)