I think it makes sense to override REMOTE_HOST in the same way it does for REMOTE_ADDR. I'd expect frontend servers will only set IP address, not the host names in X-Forwarded-For header, but the CGI spec says:
REMOTE_HOST = "" | hostname | hostnumber
so it's fine to store the IP address to REMOTE_HOST.
--
Tatsuhiko Miyagawa
On Wednesday, February 8, 2012 at 5:45 AM, Tomas Doran via RT wrote:
Show quoted text> Wed Feb 08 08:45:29 2012: Request 74778 was acted upon.
> Transaction: Ticket created by BOBTFISH
> Queue: Plack-Middleware-ReverseProxy
> Subject: Does not replace REMOTE_HOST (but does replace REMOTE_ADDR)
> Broken in: 0.11
> Severity: Important
> Owner: Nobody
> Requestors: bobtfish@bobtfish.net (mailto:bobtfish@bobtfish.net)
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=74778 >
>
>
> I'd expect $env->{REMOTE_HOST} to be overridden in the same manor that
> $env->{HTTP_HOST} and $env->{REMOTE_ADDR} are.
>
> It isn't, meaning $env->{REMOTE_HOST} contains the name (or IP of) your
> proxy server, rather than the end user.
>
> This causes Plack::Request's ->remote_addr method to return the proxy,
> rather than the end user - which is unexpected.
>
> This issue is also present in Catalyst, which has the same behavior -
> this ticket is from a user bug report, and I'm assuming it is a bug
> rather than deliberate as it isn't documented, and the behavior is
> inconsistent between the two REMOTE_ keys.
>
>