From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.86.23.1 with SMTP id 1cs218646fgw; Sun, 30 Aug 2009 12:02:03 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.224.50.1 as permitted sender) client-ip=10.224.50.1; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.224.50.1 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.224.50.1]) by 10.224.50.1 with SMTP id x1mr6091752qaf.7.1251658922120 (num_hops = 1); Sun, 30 Aug 2009 12:02:02 -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=EPV3OqYgHrOQfNxzOW9apGzvusfvaCNcS1W7fw+OmKs=; b=S4TmgF71NE4fvrcNnKZ6NCADM0sLfpdz4l0B7qorTpzigp5LrY+mrqQE9HSG4VrwBg VtwIdq1SY2h0BVFxJjannJUJKp9ph5PfLSlMl5Oa2Xn+Pn2XoF2caBcoJDR0wOh2c1Rd cXX6tz/LV3ohu6NhgRSVutE1gBoCcFv5xhNoI= 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=FhJ85pq1NbIL3RBq6vN3cjDdT3bZWyjCuXVJbEVo5/AW6RpgfSZfBrOGh5FXn8GVjK schhQOBN9LRKkQgHZGi7NoHtD3dy/bcDhLICVKmeEQlQM9njqmtRV0pssfkVHnCEEUQm dn8VneACrwVs7Jnv0B2ZgONNBDb/Fad2gKFTk= Received: by 10.224.50.1 with SMTP id x1mr1043511qaf.7.1251658921990; Sun, 30 Aug 2009 12:02:01 -0700 (PDT) Received: by 10.177.38.34 with SMTP id q34gr1629yqj.0; Sun, 30 Aug 2009 11:52:22 -0700 (PDT) X-Sender: wycats@gmail.com X-Apparently-To: rack-devel@googlegroups.com Received: by 10.224.61.78 with SMTP id s14mr640151qah.24.1251658340939; Sun, 30 Aug 2009 11:52:20 -0700 (PDT) Received: by 10.224.61.78 with SMTP id s14mr640150qah.24.1251658340885; Sun, 30 Aug 2009 11:52:20 -0700 (PDT) Return-Path: Received: from mail-qy0-f183.google.com (mail-qy0-f183.google.com [209.85.221.183]) by gmr-mx.google.com with ESMTP id 18si407168qyk.5.2009.08.30.11.52.19; Sun, 30 Aug 2009 11:52:19 -0700 (PDT) Received-SPF: pass (google.com: domain of wycats@gmail.com designates 209.85.221.183 as permitted sender) client-ip=209.85.221.183; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of wycats@gmail.com designates 209.85.221.183 as permitted sender) smtp.mail=wycats@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by mail-qy0-f183.google.com with SMTP id 13so2210121qyk.3 for ; Sun, 30 Aug 2009 11:52:19 -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=CXtpGnAq6HPgcta3EIow49tBDoSeUk/e70by/MoU6y8=; b=kUqfSW4+YPN1LrJR+7Z3fXROlvVeDSP6X7UcvVUb/+vfBMXP7E6q6fvCsWEbxlfUvY 6nDs7aqWyPBmWS+ag50Gk77oXkJj8Q2gjLeua9Nunkl1Yga2Hr1INQBli6cVGrsXgEwg aidk3+2NjjedBOX1ElkTCGc6sC/Db+CDr7W1o= 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=FAWbYtmdjRgFM2s/effywhg9OiKwLW/+Tj9pTv6oi5Qn09jWC6XAniEAw40FiXudN/ CSvlt8fohdM5XM+77VZf96NNYdwcXBCktrkqF5hlUIYgIF6pDPhgYNQmY6w5gotmAGzJ 3hO1d16fpX401bCkrVQxvaNNqpI9DMrhb0zgc= MIME-Version: 1.0 Received: by 10.224.57.21 with SMTP id a21mr2845987qah.122.1251658339123; Sun, 30 Aug 2009 11:52:19 -0700 (PDT) In-Reply-To: <391a49da0908301127l3d70a1c6y99bfca94f15d298b@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> <391a49da0908301127l3d70a1c6y99bfca94f15d298b@mail.gmail.com> From: Yehuda Katz Date: Sun, 30 Aug 2009 13:51:59 -0500 Message-ID: <245fb4700908301151p6a228dceu8afc156286f8ee11@mail.gmail.com> Subject: Re: Lighttpd's FastCGI Environment To: rack-devel@googlegroups.com Content-Type: multipart/alternative; boundary=000feaeebad4af02da0472606a93 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 --000feaeebad4af02da0472606a93 Content-Type: text/plain; charset=ISO-8859-1 Then we need a lighty adapter that inherits from the FCGI one. -- Yehuda On Sun, Aug 30, 2009 at 1:27 PM, Magnus Holm wrote: > 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 >>> >> >> > -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 --000feaeebad4af02da0472606a93 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Then we need a lighty adapter that inherits from the FCGI one.

-- Yehuda

On Sun, Aug 30, 2009 at = 1:27 PM, Magnus Holm <judofyr@gmail.com> wrote:
IMO, Rack::Handler::FastCGI should strictly= follow the FastCGI spec. If the FastCGI doesn't mention it, we shouldn= 't take care of it.=A0

//Magnus Holm



On Sun, Aug 30, 2009 at 10:45, Martin Bo= ese <boesemar@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
<=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 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:=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.1325





--
Yehuda Katz=
Developer | Engine Yard
(ph) 718.877.1325
--000feaeebad4af02da0472606a93--