From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.86.23.1 with SMTP id 1cs144664fgw; Fri, 28 Aug 2009 15:15:36 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.220.82.208 as permitted sender) client-ip=10.220.82.208; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.220.82.208 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.220.82.208]) by 10.220.82.208 with SMTP id c16mr6566508vcl.28.1251497735514 (num_hops = 1); Fri, 28 Aug 2009 15:15:35 -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=T+wpafbRhftK6ED6B3vXOivzQrPDoGQtmeqdZ/046Ug=; b=gnwfZP81/SzWuclmK3qjU5ujGeqY6bLvmDoA6RfFKMkpa16mYreP907ZzHjrD9N0Va 5QxkLnL74xi2rbSmlXJk98lnD1JjtGgHApyH9Rpw42bK6Ewf0RLxFtv4L9V02Eziym+0 IjJs4SEB1SH488tORmLh7raPxlIOcAUVT7IJ0= 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=ylaiPzLPadyOCaa7paTzHwY+a7bJe8aq5uTs5+Rb+qapboer7A+WwMGzRhKefqYdxF ADlJs2ofHIb4MV2WNTpkzwFV3G0cngc58GEOuvwx31pWwimNs5qiR5Wi+h5wP467gl+g Y41JTOSYvKf0Y2XbpslSadn4bQMS7shbQkxgA= Received: by 10.220.82.208 with SMTP id c16mr1014173vcl.28.1251497735436; Fri, 28 Aug 2009 15:15:35 -0700 (PDT) Received: by 10.230.17.76 with SMTP id r12gr1615vba.0; Fri, 28 Aug 2009 13:43:58 -0700 (PDT) X-Sender: wycats@gmail.com X-Apparently-To: rack-devel@googlegroups.com Received: by 10.220.78.42 with SMTP id i42mr597614vck.12.1251492237481; Fri, 28 Aug 2009 13:43:57 -0700 (PDT) Received: by 10.220.78.42 with SMTP id i42mr597613vck.12.1251492237402; Fri, 28 Aug 2009 13:43:57 -0700 (PDT) Return-Path: Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by gmr-mx.google.com with ESMTP id 19si138356vws.12.2009.08.28.13.43.56; Fri, 28 Aug 2009 13:43:56 -0700 (PDT) Received-SPF: pass (google.com: domain of wycats@gmail.com designates 74.125.92.27 as permitted sender) client-ip=74.125.92.27; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of wycats@gmail.com designates 74.125.92.27 as permitted sender) smtp.mail=wycats@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by qw-out-2122.google.com with SMTP id 9so567551qwb.23 for ; Fri, 28 Aug 2009 13:43:56 -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=y2lmCOsmuUSTgrL8fFE25juWITSeaN/eemvGpiEQ6+M=; b=mMonjMipZuNW9znGCJ53rfdsTXYX5i1Ty6jRY3jNQS9Do4xH+e2IOEoCwL+Ww9pFl1 6PX7NatyFK0J4Z0QFRU7/wR+bAmweC0A6tCR4rP4NLLDece466pdGCCTizck3a6SmGnh XTEH7w6bSJuDHmi7Q8bllSn0xljhEC1nPaoyQ= 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=Y3ZJXBOaZsP2WuUoNs0HfVB/Y28YYXybcu2cl7E52YqyU99D/WeYtFMQL3m1taMCHJ vJR4HcYf48QcMLbRzMdgjUxP9VL6rtaVRUcOl/93Q8nbRVKXXo0IlUaqgRgM41MVYxEQ IMAM2DYp9o3gcOE0xPtinarhFyabNW5s3/LHA= MIME-Version: 1.0 Received: by 10.224.92.131 with SMTP id r3mr1613528qam.37.1251492236106; Fri, 28 Aug 2009 13:43:56 -0700 (PDT) In-Reply-To: <3e2b1eee-ce69-440c-914a-db96ca1d7225@m38g2000yqh.googlegroups.com> References: <3e2b1eee-ce69-440c-914a-db96ca1d7225@m38g2000yqh.googlegroups.com> From: Yehuda Katz Date: Fri, 28 Aug 2009 15:43:36 -0500 Message-ID: <245fb4700908281343l68777b77rf2f80e19faf151f1@mail.gmail.com> Subject: Re: Lighttpd's FastCGI Environment To: rack-devel@googlegroups.com Content-Type: multipart/alternative; boundary=000feae85bc72c2bc6047239bee6 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 --000feae85bc72c2bc6047239bee6 Content-Type: text/plain; charset=ISO-8859-1 These sounds like bugs in the Rack LightHTTP adapter. It looks like LightHTTP is supposed to work: http://rack.rubyforge.org/doc/ -- Yehuda On Fri, Aug 28, 2009 at 9:37 AM, 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 --000feae85bc72c2bc6047239bee6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable These sounds like bugs in the Rack LightHTTP adapter. It looks like LightHT= TP is supposed to work:=A0http:/= /rack.rubyforge.org/doc/

-- Yehuda

On Fri, Aug 28, 2009 at 9:37 AM, bones <boesemar@googlemail.com> wrote:<= br>

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

=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.include?(= '?')
=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 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
Develope= r | Engine Yard
(ph) 718.877.1325
--000feae85bc72c2bc6047239bee6--