From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.86.23.1 with SMTP id 1cs201308fgw; Sun, 30 Aug 2009 01:46:16 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.150.59.12 as permitted sender) client-ip=10.150.59.12; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.150.59.12 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.59.12]) by 10.150.59.12 with SMTP id h12mr6627587yba.6.1251621974926 (num_hops = 1); Sun, 30 Aug 2009 01:46:14 -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 :date:message-id:subject:from:to:content-type:reply-to:sender :precedence:x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; bh=G5zb1ac9/mlY1+Lpu8Uq3uOlMGWetQjBo6v20ANYjUM=; b=u+675PP956UIYI8kPaDRur9EbO/NzozXwjm9nWXPwCM7MYLxKO7JfwNIPQqxXP5ksk IGzfCF6MilW5hkoTwHX8eDU9NQFdnzNqp3YThQmSzUiEpvWI4qQzMS6RFihz/G0PeBm1 WNwYgGQK6A8OoklIpjLYzUrAhNqWWPTarJirg= 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:date:message-id:subject:from:to:content-type:reply-to :sender:precedence:x-google-loop:mailing-list:list-id:list-post :list-help:list-unsubscribe:x-beenthere-env:x-beenthere; b=Q4MYjbTRuhgB47GE4UTdAkog8i5qqJOy8kDFGoxb4ng0QjCfy3x0XfPzMZaVwIbX0C QqeaK9rN/Fbx8wAm/uDMZs8v1X6GpkrLRO1rYafI3afddIczARBwPF2oFWOrVLBWXVTV 8tJbKclqUhe1Q871b+j0ZCREisYssn8mlb3Qk= Received: by 10.150.59.12 with SMTP id h12mr1143537yba.6.1251621974871; Sun, 30 Aug 2009 01:46:14 -0700 (PDT) Received: by 10.176.54.11 with SMTP id c11gr1625yqa.0; Sun, 30 Aug 2009 01:46:01 -0700 (PDT) X-Sender: boesemar@googlemail.com X-Apparently-To: rack-devel@googlegroups.com Received: by 10.210.20.19 with SMTP id 19mr426197ebt.14.1251621960349; Sun, 30 Aug 2009 01:46:00 -0700 (PDT) Received: by 10.210.20.19 with SMTP id 19mr426196ebt.14.1251621960300; Sun, 30 Aug 2009 01:46:00 -0700 (PDT) Return-Path: Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by gmr-mx.google.com with ESMTP id 15si695715ewy.0.2009.08.30.01.45.59; Sun, 30 Aug 2009 01:45:59 -0700 (PDT) Received-SPF: pass (google.com: domain of boesemar@googlemail.com designates 209.85.219.211 as permitted sender) client-ip=209.85.219.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of boesemar@googlemail.com designates 209.85.219.211 as permitted sender) smtp.mail=boesemar@googlemail.com; dkim=pass (test mode) header.i=@googlemail.com Received: by mail-ew0-f211.google.com with SMTP id 7so3038747ewy.7 for ; Sun, 30 Aug 2009 01:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=HW+HEERJcia1X+I3ydUFRB8Sue/cAzVIs0WUXq96LSE=; b=GpyIv5rUpppKP4k2ssC//qrRVC4YwRGdrthpDIGvjZ532Q9BqKrYNqHAbAyB3k258c 5lChI69VwCVWwVrzXKtrvgM5BcKdok4N1jqaqXQj28raLP9qGSQsy8pClPkNpQnr9mi7 VrqBOX3Vm21085YH3xW11ngzhIE2K3Z6N65Nc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=a0J/cwMWn52C8vHhmQf+lZApFfo6qZm9f9tJtqPNLfQwcHnnAAeui/9tpqlTHCdtRO FTWpRbx+WpCVm7HTBG9KQRvhGShq1VMgeX+zTuZCK3efb73ruHNPhbGXZp7JkKntanQH JmtC/ts7WvRE5eDOxWcuDPFjtErsRThoXk9gU= MIME-Version: 1.0 Received: by 10.210.138.9 with SMTP id l9mr1771874ebd.23.1251621959130; Sun, 30 Aug 2009 01:45:59 -0700 (PDT) In-Reply-To: <245fb4700908290706t61303c90x7ee12ca2d7b2b33d@mail.gmail.com> References: <3e2b1eee-ce69-440c-914a-db96ca1d7225@m38g2000yqh.googlegroups.com> <391a49da0908281522k3797de17k3bd7e79f963510a7@mail.gmail.com> <27eae4af0908290117l221e57c9lf8ca5347c9c83094@mail.gmail.com> <245fb4700908290706t61303c90x7ee12ca2d7b2b33d@mail.gmail.com> Date: Sun, 30 Aug 2009 09:45:59 +0100 Message-ID: <27eae4af0908300145n1757ca91xfd768ff0e708af04@mail.gmail.com> Subject: Re: Lighttpd's FastCGI Environment From: Martin Boese To: rack-devel@googlegroups.com Content-Type: multipart/alternative; boundary=0015174c3744445fb8047257f223 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 --0015174c3744445fb8047257f223 Content-Type: text/plain; charset=ISO-8859-1 You mean the Rack FastCGI Handler... if that's the case, this fix works for me: rack-1.0.0/lib/rack/handler/fastcgi.rb 48c48,55 < env["QUERY_STRING"] ||= "" --- > if env["PATH_INFO"].to_s.empty? then > env["PATH_INFO"] = env["REQUEST_URI"].split('?')[0] > end > > if env['QUERY_STRING'].to_s.empty? then > env['QUERY_STRING'] = env['REQUEST_URI'].scan(/.+?\?(.*)/).to_s > end > On Sat, Aug 29, 2009 at 3:06 PM, Yehuda Katz wrote: > That is definitely the intention. This should be fixed in the rack lighty > adapter. > -- Yehuda > > > On Sat, Aug 29, 2009 at 3:17 AM, Martin Boese wrote: > >> >> On Fri, Aug 28, 2009 at 11:22 PM, Magnus Holm wrote: >> > >> > There is another know issue with Lighttpd: >> http://github.com/rack/rack/blob/master/KNOWN-ISSUES >> > >> > Maybe they're related? >> > >> > //Magnus Holm >> >> Thanks, yes that sounds related. >> >> I was hoping that Rack will give me a standard set of environments no >> matter in which technologie the applicaion is deployed at the end. >> But I guess that should be fixed in Lighttpd's cgi implementation >> instead... >> >> Martin >> >> >> > >> > >> > On Fri, Aug 28, 2009 at 16:37, bones wrote: >> >> >> >> >> >> I am porting my application from ruby fcgi to rack which is in >> >> production using the Lighttpd webserver. >> >> >> >> I noticed that lighttpd doesn't send PATH_INFO or QUERY_STRING so I >> >> used to patch it by reconstructing it from REQUEST_URI. Now with Rack >> >> I have exactly the same situation. Rack::Request.GET is empty. This >> >> fix on the environment makes it working: >> >> >> >> class RackApp >> >> >> >> def fix_env(ec) >> >> if (ec['PATH_INFO'].to_s.empty?) then >> >> pi = ec['REQUEST_URI'] >> >> pi = pi[0..(pi.index('?')-1)] if pi.include?('?') >> >> ec['PATH_INFO'] = pi >> >> end >> >> >> >> if (ec['QUERY_STRING'].to_s.empty?) then >> >> ec['QUERY_STRING'] = ec['REQUEST_URI'].include?('?') ? >> >> ec['REQUEST_URI'].scan(/.?\?(.*)/)[0][0] : >> >> "" >> >> end >> >> ec >> >> end >> >> >> >> def call(env) >> >> Rack::Request.new(fix_env(env)) >> >> # [...] >> >> end >> >> end >> >> >> >> >> >> As far as I know Lighttpd and Rails (which used Rack?!) is a popular >> >> combination - so I am quiet surprised that I don't find anything >> >> related on the web. Especially - shouldn't that be implemented into >> >> Rack's CGI/FastCGI Handler? >> >> >> >> Cheers, >> >> Martin >> > >> > >> > > > > -- > Yehuda Katz > Developer | Engine Yard > (ph) 718.877.1325 > --0015174c3744445fb8047257f223 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable You mean the Rack FastCGI Handler...

if that's the case, this fi= x works for me:

rack-1.0.0/lib/rack/handler/fastcgi.rb

48c48,= 55
<=A0=A0=A0=A0=A0=A0=A0=A0 env["QUERY_STRING"] ||=3D &quo= t;"
---
>=A0=A0=A0=A0=A0=A0=A0=A0 if env["PATH_INFO"].to_s.empty? then=
>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 env["PATH_INFO"] =3D en= v["REQUEST_URI"].split('?')[0]
>=A0=A0=A0=A0=A0=A0= =A0=A0 end
>=A0=A0=A0=A0=A0=A0=A0=A0
>=A0=A0=A0=A0=A0=A0=A0=A0= if env['QUERY_STRING'].to_s.empty? then
>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 env['QUERY_STRING'] =3D env[&= #39;REQUEST_URI'].scan(/.+?\?(.*)/).to_s
>=A0=A0=A0=A0=A0=A0=A0= =A0 end
>




On Sat, Aug = 29, 2009 at 3:06 PM, Yehuda Katz <wycats@gmail.com> wrote:
That is definitel= y the intention. This should be fixed in the rack lighty adapter.

<= /div>
-- Yehuda


On Sat, Aug 29, 2009 at 3:17 AM, Mar= tin Boese <boesemar@googlemail.com> wrote:

On Fri, Aug 28, 2009 at 11:22 PM, Magnus Holm <judofyr@gmail.com> wrote:
>
> There is another know issue with Lighttpd:=A0http://github.com= /rack/rack/blob/master/KNOWN-ISSUES
>
> Maybe they're related?
>
> //Magnus Holm

Thanks, yes that sounds related.

I was hoping that Rack will give me a standard set of environments no
matter in which technologie the applicaion is deployed at the end.
But I guess that should be fixed in Lighttpd's cgi implementation inste= ad...

Martin


>
>
> On Fri, Aug 28, 2009 at 16:37, bones <boesemar@googlemail.com> wrote:
>>
>>
>> I am porting my application from ruby fcgi to rack which is in
>> production using the Lighttpd webserver.
>>
>> I noticed that lighttpd doesn't send PATH_INFO or QUERY_STRING= so I
>> used to patch it by reconstructing it from REQUEST_URI. Now with R= ack
>> I have exactly the same situation. Rack::Request.GET is empty. Thi= s
>> fix on the environment makes it working:
>>
>> class RackApp
>>
>> =A0def fix_env(ec)
>> =A0 =A0 =A0 if (ec['PATH_INFO'].to_s.empty?) then
>> =A0 =A0 =A0 =A0 =A0pi =3D =A0ec['REQUEST_URI']
>> =A0 =A0 =A0 =A0 =A0pi =3D pi[0..(pi.index('?')-1)] if pi.i= nclude?('?')
>> =A0 =A0 =A0 =A0 =A0ec['PATH_INFO'] =3D pi
>> =A0 =A0 =A0 end
>>
>> =A0 =A0 =A0 if (ec['QUERY_STRING'].to_s.empty?) then
>> =A0 =A0 =A0 =A0 =A0ec['QUERY_STRING'] =3D ec['REQUEST_= URI'].include?('?') ?
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0ec['REQUEST_URI'].scan(/.?\?(.*= )/)[0][0] :
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0""
>> =A0 =A0 =A0 end
>> =A0 =A0 =A0 ec
>> =A0end
>>
>> =A0def call(env)
>> =A0 =A0Rack::Request.new(fix_env(env))
>> =A0 # [...]
>> =A0end
>> end
>>
>>
>> As far as I know Lighttpd and Rails (which used Rack?!) is a popul= ar
>> combination - so I am quiet surprised that I don't find anythi= ng
>> related on the web. Especially - shouldn't that be implemented= into
>> Rack's CGI/FastCGI Handler?
>>
>> Cheers,
>> Martin
>
>



--
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1= 325

--0015174c3744445fb8047257f223--