diff options
author | Loïc Hoguin <[email protected]> | 2013-04-11 14:38:19 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-04-11 22:25:36 +0200 |
commit | 67beb4d01db70d38d9dd389fd5e2ea073bab44e7 (patch) | |
tree | 0dde9badcb34a20084c3eb12095989be8b984fb6 | |
parent | be94cb12aa6a6b8b4685eed5d74e1037333d85a7 (diff) | |
download | cowboy-67beb4d01db70d38d9dd389fd5e2ea073bab44e7.tar.gz cowboy-67beb4d01db70d38d9dd389fd5e2ea073bab44e7.tar.bz2 cowboy-67beb4d01db70d38d9dd389fd5e2ea073bab44e7.zip |
Parse the x-forwarded-for header as a list of tokens
-rw-r--r-- | src/cowboy_req.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl index 4cb5636..4ad2321 100644 --- a/src/cowboy_req.erl +++ b/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) |