IP can be in HTTP_X_FORWARDED_FOR instead of X_FORWARDED_FOR. By the way the 'address' should automatically use 'forwarded_for_address' if proxy_pass is set, should'nt it?
fixed forwarded_for_address: IP can be in HTTP_X_FORWARDED_FOR} inste…
…ad of X_FORWARDED_FOR
In what situation will it be HTTP_X_FORWARDED_FOR?
I believe the PSGI spec only speaks of X_FORWARDED_FOR.
The PSGI spec only speaks of HTTP_... headers, that "correspond to the client-supplied HTTP request headers" and the "key is obtained converting the HTTP header field name to upper case, replacing all occurrences of hyphens - with underscores and prepending HTTP, as in RFC 3875." It highly depends on your Deployment environment whether X_FORWARDED_FOR or HTTP_X_FORWARDED_FOR is set.
Could you clarify how you would end up with the HTTP_ string not being prepended to the keys of the HTTP headers? I think the plain reading of the PSGI spec indicates that the HTTP headers will have HTTP_ prepended. While the XFF header isn't (typically) provided by the "final" or "real" client, it is nevertheless provided by the client from PSGI's point of view. As such, you should expect it to have the prefix, and look for it in the environment accordingly.
And in response to the original suggestion to for address to DTRT... Dancer should either figure out the right value, or not promise that it is providing the client's IP.
Merge branch 'pr/767' into devel