fixed forwarded_for_address #767

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

nichtich commented Mar 28, 2012

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?

Owner

xsawyerx commented Apr 1, 2012

In what situation will it be HTTP_X_FORWARDED_FOR?

I believe the PSGI spec only speaks of X_FORWARDED_FOR.

Contributor

nichtich commented Apr 2, 2012

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.

doherty commented Jan 19, 2013

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.

doherty commented Jan 19, 2013

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.

@yanick yanick closed this in 0d6428f Jun 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment