From: Michael Fellinger <m.fellinger@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: Mongrel handler doesn't set env[REMOTE_ADDR] with the value of "X-Forwarded-For" header
Date: Sun, 13 Sep 2009 23:51:31 +0200 [thread overview]
Message-ID: <9c00d3e00909131451g362f6148nb7c2b04402bd53e6@mail.gmail.com> (raw)
In-Reply-To: <200909131752.14504.ibc@aliax.net>
On Sun, Sep 13, 2009 at 5:52 PM, Iñaki Baz Castillo <ibc@aliax.net> wrote:
>
> Hi, usually when a http proxy routes a request it adds a "X-Forwarded-For:
> CLIENT_IP" to the request so the web server can know the client IP of the
> request.
>
> In fact, using Thin handler, env[REMOTE_ADDR] is set to the value of
> X-Forwarded-For header (if present).
>
> However using Mongrel or Webrick handlers it doesn't occur and
> env[REMOTE_ADDR] is set to the http proxy IP.
>
> Anyhow I don't see it described in Rack specifications so perhaps it's not
> mandatory.
I think many frameworks actually show X-Forwarded-For instead of
REMOTE_ADDR if available via Request#ip, not sure whether overwriting
is a good idea, I'm not a fan of losing information.
>
> --
> Iñaki Baz Castillo <ibc@aliax.net>
>
--
Michael Fellinger
CTO, The Rubyists, LLC
next prev parent reply other threads:[~2009-09-13 21:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-13 15:52 Mongrel handler doesn't set env[REMOTE_ADDR] with the value of "X-Forwarded-For" header Iñaki Baz Castillo
2009-09-13 21:51 ` Michael Fellinger [this message]
2009-09-13 22:08 ` Iñaki Baz Castillo
2009-09-13 22:14 ` Aman Gupta
2009-09-13 22:44 ` Iñaki Baz Castillo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://groups.google.com/group/rack-devel
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9c00d3e00909131451g362f6148nb7c2b04402bd53e6@mail.gmail.com \
--to=rack-devel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).