Fix parsing X-Forwarded-For header.#296
Fix parsing X-Forwarded-For header.#296amiart wants to merge 2 commits intotreefrogframework:masterfrom
Conversation
|
To keep the specification simple, I would like to omit the ParseForwardedForHeaderRecursively parameter. |
The ParseForwardedForHeaderRecursively parameter is needed, if you want to trust only proxies that connect directly to the treefrog server, e.g. when I'm in a local network I connect through a proxy server 192.168.1.10, and being outside this network I connect through a proxy server with a public IP like 213.25.134.23 and then I don't want to trust 192.168.1.10 anymore. This is an equivalent to the real_ip_recursive parameter of the nginx server: If you don't like the name of this parameter then you can change it.
The implementation doesn't expect 'unix:' in the header - see the code. See also nginx set_real_ip_from parameter - it accepts 'unix:' value: |
About the node identifier, does it meet the RFC7239? |
|
The apache server doesn't have it, so it seems it's a nginx-specific solution. |
|
I think it can support the following two patterns: |
|
So you want to always trust proxy for unix: socket ? |
|
Changed the code, so now TrustedProxyServers parameter accepts only IP addresses or subnets and the UNIX domain socket proxy is always trusted. |
|
About unix domain, it's a specification in RFC? |
|
Sorry, but I don't have such knowledge. |
|
Unfortunately, this pull-request is not acceptable. |
|
What's wrong with the patch ? |
Fixes parsing of the header, and it is now possible to trust Unix domain socket proxy and proxy servers in a subnet.
In nginx configuration (reverse proxy) add this line:
In Treefrog configuration add these lines:
Fixes #285