From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.86.23.1 with SMTP id 1cs189743fgw; Sun, 13 Sep 2009 14:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.150.88.41 as permitted sender) client-ip=10.150.88.41; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.150.88.41 as permitted sender) smtp.mail=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com; dkim=pass header.i=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com Received: from mr.google.com ([10.150.88.41]) by 10.150.88.41 with SMTP id l41mr13549658ybb.17.1252878723205 (num_hops = 1); Sun, 13 Sep 2009 14:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received:received-spf:received:dkim-signature :domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding:reply-to:sender:precedence:x-google-loop :mailing-list:list-id:list-post:list-help:list-unsubscribe :x-beenthere-env:x-beenthere; bh=cpapsdXkUOavn4F5Q2GSrkXSOVpzOVzy+Ixq7ZmZk0A=; b=rpYtE0ii2hgOV1+kjrd58C5+YFcNH0BuxD+tMhOQ6CaBSHOc4aizTwOXFxN+RxUC59 CZ8TSUG2YlZlV4srnFDQy9jwnRcH0zKu/uYUOH9D/FFFxDFS3+GwP+NcAnJ7ZkpMadGC JFKJCuBrydgOXFS9lFf/NluJZsNBy6nFevWws= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results :dkim-signature:domainkey-signature:mime-version:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding:reply-to:sender:precedence:x-google-loop :mailing-list:list-id:list-post:list-help:list-unsubscribe :x-beenthere-env:x-beenthere; b=6vi2o0iw+ebJipY2qe58zwpTdFZ5A3F2oBqePeSSFCpS+Dfg6whQ8g4dk3on1OiLd5 PudpPp2I6x3qNldTLJ5YCT+jWNqIk0t9bepyhSmH1i6XhyQ1MKxwFrFiAc8Tayhc125l EgozOU2D9CRAl3Tm4/cidFZKrg2mf/Y+JuE70= Received: by 10.150.88.41 with SMTP id l41mr1726517ybb.17.1252878723154; Sun, 13 Sep 2009 14:52:03 -0700 (PDT) Received: by 10.177.38.34 with SMTP id q34gr1661yqj.0; Sun, 13 Sep 2009 14:51:53 -0700 (PDT) X-Sender: m.fellinger@gmail.com X-Apparently-To: rack-devel@googlegroups.com Received: by 10.101.211.1 with SMTP id n1mr2925778anq.14.1252878712340; Sun, 13 Sep 2009 14:51:52 -0700 (PDT) Received: by 10.101.211.1 with SMTP id n1mr2925777anq.14.1252878712284; Sun, 13 Sep 2009 14:51:52 -0700 (PDT) Return-Path: Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.246]) by gmr-mx.google.com with ESMTP id 18si471882yxe.8.2009.09.13.14.51.51; Sun, 13 Sep 2009 14:51:51 -0700 (PDT) Received-SPF: pass (google.com: domain of m.fellinger@gmail.com designates 209.85.132.246 as permitted sender) client-ip=209.85.132.246; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of m.fellinger@gmail.com designates 209.85.132.246 as permitted sender) smtp.mail=m.fellinger@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by an-out-0708.google.com with SMTP id c3so388457ana.19 for ; Sun, 13 Sep 2009 14:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=33mqbJWgLuF19Ndt/mTdrDKBF54rqKJkvG2xSQCOLvs=; b=pgE7RCig/uk2PKnDwDsIgDJu0vZiJPpkHDh35aGhiH4t2A6gWHuRyahhLBikGljgIH 4iSt0v0+lQUqOCZ/N7V0C3ZXjVCgk2PEOMyNRWqaJXKCbo8tdBw23iEyCIteSV94Fw1G VpYLE16OT+46l8Ed0lmagZ/jvqSIeUSF5ArCs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=qMweToXzLQCk6+RmFNnp+6HGPa0JPxy80usoGUl7SsoqyqCc8eNUhsWHXBbf/95UOw hHGqmD76EaNsXS7yT59fpXEqVJGGcQ9WtPbC41eMHwCmMoK173Sqy5MNauiS2A6RWcNu tcpnCloW+ntJEt1jVpVgx7FOTsP2QqUc5s/5k= MIME-Version: 1.0 Received: by 10.101.109.11 with SMTP id l11mr5571144anm.145.1252878711158; Sun, 13 Sep 2009 14:51:51 -0700 (PDT) In-Reply-To: <200909131752.14504.ibc@aliax.net> References: <200909131752.14504.ibc@aliax.net> From: Michael Fellinger Date: Sun, 13 Sep 2009 23:51:31 +0200 Message-ID: <9c00d3e00909131451g362f6148nb7c2b04402bd53e6@mail.gmail.com> Subject: Re: Mongrel handler doesn't set env[REMOTE_ADDR] with the value of "X-Forwarded-For" header To: rack-devel@googlegroups.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Reply-To: rack-devel@googlegroups.com Sender: rack-devel@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rack-devel@googlegroups.com; contact rack-devel+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rack-devel@googlegroups.com X-BeenThere: rack-devel@googlegroups.com On Sun, Sep 13, 2009 at 5:52 PM, I=C3=B1aki Baz Castillo wr= ote: > > 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 no= t > 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=C3=B1aki Baz Castillo > --=20 Michael Fellinger CTO, The Rubyists, LLC