Ticket #729 (closed defect: fixed)

Opened 2 years ago

Last modified 2 months ago

Incorrect PATH_INFO when FastCGI is serving "/"

Reported by: anonymous Assigned to: moo
Priority: normal Milestone: 1.4.20
Component: mod_fastcgi Version: 1.4.11
Severity: normal Keywords:
Cc: joss@debian.org, lindevel@gmx.net Blocking:
Need Feedback: 0

Description

When mod_fastcgi is serving "/" i.e. configured as following

fastcgi.server = (
   "/" => (
      ...
   )
)

it produces wrong SCRIPT_NAME and PATH_INFO.

For example, request for /test/url is represented as

SCRIPT_NAME = "/test"
PATH_INFO = "/url"

while it has to be

SCRIPT_NAME = ""
PATH_INFO = "/test/url"

Interesting that mod_scgi doesn't have that issue.

Attachments

729.patch (1.2 kB) - added by dg on 11/03/2006 08:57:45 PM.
One slightly hacky fix for mod_fastcgi, needs porting to mod_scgi (and more testing!)

Change History

07/08/2006 11:22:00 PM changed by mgood

This occurs when mapping any URL ending in "/" to FastCGI. The same mapping with the ending "/" removed works correctly.

08/16/2006 09:10:46 PM changed by teg@jklm.no

This causes problems for trac, when it is sitting in the root directory. See trac bug 2418.

11/03/2006 08:57:45 PM changed by dg

  • attachment 729.patch added.

One slightly hacky fix for mod_fastcgi, needs porting to mod_scgi (and more testing!)

01/09/2007 05:01:03 PM changed by anonymous

Any idea why this has not been checked in? It doesn't look hackish, given we also port it to all places using the same code.

01/28/2007 08:04:18 AM changed by shot@hot.pl

FWIW, the above patch fixes this bug for mod_scgi as well (in my case, tested with DrProject?).

05/11/2007 07:24:58 AM changed by joss@debian.org

I've been hit by the same problem when trying to use Moin as the root URI.

There is no straightforward solution to this, as there is no generic pattern for splitting the URI in SCRIPT_NAME and PATH_INFO. In some cases you want the whole URI in PATH_INFO, in some other cases you want SCRIPT_NAME to be set, and you could imagine thousands of other cases.

I'd like this to be fixed by a URI => PATH_INFO mapping, with a new configuration variable. The result could look like this:

fastcgi.path_info = (

"/(admin|stats)/(.*)" => ("/$1", "/$2"), "(.*)$" => ("", "$1"),

)

This way /admin/foo would lead to SCRIPT_NAME="/admin" and PATH_INFO="/foo", while /bar would lead to SCRIPT_NAME="" and PATH_INFO="/bar".

08/03/2007 07:25:18 AM changed by joss

  • cc set to joss@debian.org.
  • blocking changed.
  • pending changed.

08/14/2007 01:16:24 PM changed by lindevel@gmx.net

  • cc changed from joss@debian.org to joss@debian.org, lindevel@gmx.net.

The problem is still present on 1.4.16...

02/23/2008 03:38:57 PM changed by lindevel@gmx.net

And still in 1.4.18, it seems...

03/27/2008 02:48:25 AM changed by schnouki@schnouki.net

This patch works great for me. I couldn't get a Mercurial repository (hgwebdir cgi script) working on my web server without it.

Please include it!

05/22/2008 03:45:32 AM changed by moo

  • owner changed from jan to moo.
  • status changed from new to assigned.
  • milestone set to 1.4.20.

05/22/2008 08:49:26 AM changed by moo

this problem is fixed in 1.5.0, i'm working out a solution to this for 1.4.x

05/22/2008 10:04:14 AM changed by moo

  • status changed from assigned to closed.
  • resolution set to fixed.

fixed in [2182], use "fix-root-scriptname" => "enable" to workaround, untested yet. can u pls test it?


Add/Change #729 (Incorrect PATH_INFO when FastCGI is serving "/")




Change Properties
Action