Skip Menu |

This queue is for tickets about the Plack-Middleware-ReverseProxy CPAN distribution.

Report information
The Basics
Id: 78693
Status: rejected
Priority: 0/
Queue: Plack-Middleware-ReverseProxy

People
Owner: Nobody in particular
Requestors: adamlounds [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.14
Fixed in: (no value)



Subject: X-forwarded-for behaviour incorrect?
The format of the x-forwarded-for header is client, proxy1, proxy2, but this module incorrectly takes the last item in the list as the client ip address Changing the regex to my ( $ip, ) = split /,/, $env-> {HTTP_X_FORWARDED_FOR}; fixes the problem (although it does not deal with "X-Forwarded-For: unknown" eg http://www.squid-cache.org/Doc/ config/forwarded_for/) Ah. It may be that the documentation isn't clear and that this module is only moving the ip down a single level in order to hide the single reverse proxy. My understanding was that $env->{REMOTE_ADDR} would be set to the actual client's ip address rather than the ip address of the last upstream proxy. Any chance of clarifying this in the docs? --- http://en.wikipedia.org/wiki/X-Forwarded-For The general format of the field is: X-Forwarded-For: client, proxy1, proxy2 where the value is a comma+space separated list of IP addresses, the left-most being the original client, and each successive proxy that passed the request adding the IP address where it received the request from. In this example, the request passed proxy1, proxy2 and proxy3 (proxy3 appears as remote address of the request).
From: adamlounds [...] gmail.com
Actually, please close this bug report; the approach taken by this module is obviously the correct one as nothing beyond our own proxies can be trusted. Logging or using any other IP is bound to cause issues; if we really want to look at the other IPs in the XFF header we can do it manually - it's not the place of a plugin to do it on every request. Thx :-)