#60 ✓wontfix
Arturo

Rack Bug with FCGI - All URIs go to '/'

Reported by Arturo | July 24th, 2009 @ 09:19 AM

Hi guys,

I've been trying to deploy my merb app using fcgi on dreamhost for like 4 days now, and I think I found a bug in Rack. The problem is that all my URLs
were sent to the '/' route. Here's what I found:

in

# rack-1.0.0/lib/rack/handler/fastcgi.rb:50
# env["REQUEST_PATH"] ||= "/"

env["REQUEST_PATH"] is being set to "/" when it comes from the server as null,
but my web server is pushing down REQUEST_URI, not REQUEST_PATH. Now, on the
dispatcher in Merb:

# merb-core-1.0.12/lib/merb-core/dispatch/request.rb:395 # def uri # @env[Merb::Const::REQUEST_PATH] || @env[Merb::Const::REQUEST_URI] || # path_info # end

As you can see, the method 'uri' is returning one of them three depending which one has come down from the server. As Rack set the first one as '/',
all URIs become '/'.

I don't know why someone would put in that little hack in Rack setting it to '/' if it comes as null (I think we should leave it as it is, don't touch the env variables that come from the server) but removing that line solves my
problem.

  • Arturo

Comments and changes to this ticket

  • josh

    josh August 3rd, 2009 @ 03:47 PM

    • State changed from “new” to “wontfix”

    I believe setting REQUEST_PATH is required. Merb should probably be preferring REQUEST_URI or even better PATH_INFO over REQUEST_PATH for routing.

  • Arturo

    Arturo August 4th, 2009 @ 03:33 PM

    Hi Joshua, thanks.

    I believe setting REQUEST_PATH is required. Merb should probably be preferring REQUEST_URI or even better PATH_INFO over REQUEST_PATH for routing. Can you explain then
    - Why setting REQUEST_PATH to '/' is required when it comes empty - Why it should be set when applications should be using REQUEST_URI, PATH_INFO or REQUEST_PATH anyway?

    NOTE Please see the server variables attachment. REQUEST_PATH is not coming from the server at all and RACK is pushing some arbitrary value.

    Thanks a lot,

    • Arturo

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Attachments

Tags

Pages