From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.86.23.1 with SMTP id 1cs217925fgw; Sun, 30 Aug 2009 11:28:22 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.101.151.40 as permitted sender) client-ip=10.101.151.40; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.101.151.40 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.101.151.40]) by 10.101.151.40 with SMTP id d40mr8420671ano.9.1251656900860 (num_hops = 1); Sun, 30 Aug 2009 11:28:20 -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:reply-to:sender :precedence:x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; bh=B1c50Rnl8GVfoeMl2KRXsYrLQ58LcKKy5TLXLl+Vpqs=; b=xU1CLB5gsXJxO8a/maWHqLIx5vI0uzCTb4w9z+2c6QCQ/WA/S4e7el8N76OHQleB/0 GgY1D5f7UsvInu7HyRYZjf5hLDMKeXamG2AGQbdFaZ6PayjSGGZwWwUSeFAZf0v/Brq0 zb8Bh7JNd2228EQ9eBrOCknoNmMWTDuE9qsDU= 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:reply-to :sender:precedence:x-google-loop:mailing-list:list-id:list-post :list-help:list-unsubscribe:x-beenthere-env:x-beenthere; b=0DEzuFynXKhmvu2U97E1xnWj59BqqQOy8BeLmHKqDDBg4KKBUmwV7wNsfcqON9Rl6M 2/BSkgLoyQFygwQLqZf9QcMIYK9tGtKIglmGgYS+NhAipCaU1qzR4kEyiPyP/1JN21Z7 Sq0qCQb+iB0wLt33FEyUd7P5eWvJcsYRiIR78= Received: by 10.101.151.40 with SMTP id d40mr1424509ano.9.1251656900792; Sun, 30 Aug 2009 11:28:20 -0700 (PDT) Received: by 10.176.146.3 with SMTP id t3gr1628yqd.0; Sun, 30 Aug 2009 11:28:07 -0700 (PDT) X-Sender: judofyr@gmail.com X-Apparently-To: rack-devel@googlegroups.com Received: by 10.86.233.8 with SMTP id f8mr61137fgh.15.1251656886284; Sun, 30 Aug 2009 11:28:06 -0700 (PDT) Received: by 10.86.233.8 with SMTP id f8mr61136fgh.15.1251656886237; Sun, 30 Aug 2009 11:28:06 -0700 (PDT) Return-Path: Received: from mail-fx0-f222.google.com (mail-fx0-f222.google.com [209.85.220.222]) by gmr-mx.google.com with ESMTP id 5si186476fge.14.2009.08.30.11.28.05; Sun, 30 Aug 2009 11:28:05 -0700 (PDT) Received-SPF: pass (google.com: domain of judofyr@gmail.com designates 209.85.220.222 as permitted sender) client-ip=209.85.220.222; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of judofyr@gmail.com designates 209.85.220.222 as permitted sender) smtp.mail=judofyr@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by fxm22 with SMTP id 22so1416599fxm.9 for ; Sun, 30 Aug 2009 11:28:05 -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; bh=RfUZjQ460uKhmHFZvzAMtCmUxjKA+OzwdvNzglb6gG8=; b=aoVDDqNLqhhgL6bP61cln1DITPTIWeRNjo0pYc/BEoXR/8zJ9jfs6UjDEJeENHgqbL RvEqUXUhGTmKJ7JwQ9VizkdUp1UwGdjJhLvKNW+QL5Uv8I7RS00RymO98VpwWSAH/jq2 7+/UPLAxmRG7F3HAUpBJqZ6tGrlBy7fg1FkSo= 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; b=UXh5UOinqgf7owwfGdBzrpbohqNVoo6w7ReohJRNrxP16EzFr/oUlXVKnWbyFm/f1A TpZRwJXTS90NvJ5DLzo/ZrONhSITHv4wJOVlc0xnuBi8e9t52ctAWIzbBnf6sG8HZpRZ EekYy2Wiz7vhaoR3BmVuHn7Eleh4FIQyu795A= MIME-Version: 1.0 Received: by 10.103.127.34 with SMTP id e34mr1680061mun.108.1251656885084; Sun, 30 Aug 2009 11:28:05 -0700 (PDT) In-Reply-To: <27eae4af0908300145n1757ca91xfd768ff0e708af04@mail.gmail.com> References: <3e2b1eee-ce69-440c-914a-db96ca1d7225@m38g2000yqh.googlegroups.com> <391a49da0908281522k3797de17k3bd7e79f963510a7@mail.gmail.com> <27eae4af0908290117l221e57c9lf8ca5347c9c83094@mail.gmail.com> <245fb4700908290706t61303c90x7ee12ca2d7b2b33d@mail.gmail.com> <27eae4af0908300145n1757ca91xfd768ff0e708af04@mail.gmail.com> From: Magnus Holm Date: Sun, 30 Aug 2009 20:27:45 +0200 Message-ID: <391a49da0908301127l3d70a1c6y99bfca94f15d298b@mail.gmail.com> Subject: Re: Lighttpd's FastCGI Environment To: rack-devel@googlegroups.com Content-Type: multipart/alternative; boundary=0016e65c7bf004211a0472601447 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 --0016e65c7bf004211a0472601447 Content-Type: text/plain; charset=UTF-8 IMO, Rack::Handler::FastCGI should strictly follow the FastCGI spec. If the FastCGI doesn't mention it, we shouldn't take care of it. //Magnus Holm On Sun, Aug 30, 2009 at 10:45, Martin Boese wrote: > 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 >> > > --0016e65c7bf004211a0472601447 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable IMO, Rack::Handler::FastCGI should strictly follow the FastCGI spec. If the= FastCGI doesn't mention it, we shouldn't take care of it.=C2=A0
//Magnus Holm


On Sun, Aug 30, 2009 at 10:45, Martin Bo= ese <boesem= ar@googlemail.com> wrote:
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
<=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 env["QUERY_= STRING"] ||=3D ""
---
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if env["PATH_INFO= "].to_s.empty? then
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 env["PATH_INFO"] =3D env["REQUEST_U= RI"].split('?')[0]
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 end
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if env['QUERY_ST= RING'].to_s.empty? then
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 env[= 'QUERY_STRING'] =3D env['REQUEST_URI'].scan(/.+?\?(.*)/).to= _s
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 end

>




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

-- Yehuda


<= div class=3D"gmail_quote">On Sat, Aug 29, 2009 at 3:17 AM, Martin 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:=C2=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
>>
>> =C2=A0def fix_env(ec)
>> =C2=A0 =C2=A0 =C2=A0 if (ec['PATH_INFO'].to_s.empty?) then=
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pi =3D =C2=A0ec['REQUEST_URI= ']
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pi =3D pi[0..(pi.index('?= 9;)-1)] if pi.include?('?')
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ec['PATH_INFO'] =3D pi >> =C2=A0 =C2=A0 =C2=A0 end
>>
>> =C2=A0 =C2=A0 =C2=A0 if (ec['QUERY_STRING'].to_s.empty?) t= hen
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ec['QUERY_STRING'] =3D e= c['REQUEST_URI'].include?('?') ?
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ec['REQUEST_UR= I'].scan(/.?\?(.*)/)[0][0] :
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0""
>> =C2=A0 =C2=A0 =C2=A0 end
>> =C2=A0 =C2=A0 =C2=A0 ec
>> =C2=A0end
>>
>> =C2=A0def call(env)
>> =C2=A0 =C2=A0Rack::Request.new(fix_env(env))
>> =C2=A0 # [...]
>> =C2=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.1325


--0016e65c7bf004211a0472601447--