Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1305 closed defect (wontfix)

Using SCRIPT_NAME as path to trac.cgi leads to 'unprettied' links when using lighttpd

Reported by: Mark Rowe <edgewall.com@…> Owned by: Jonas Borgström
Priority: normal Milestone:
Component: general Version: 0.8.1
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

With lighttpd configured to rewrite /dev/ as /cgi-bin/trac.cgi, SCRIPT_NAME is set to /cgi-bin/trac.cgi. This differs from Apache where it would be set to the URL before it is rewritten — /dev/. This results in generated links being of the form /cgi-bin/trac.cgi/timeline/, which are less than perfect.

Attachments (1)

trac-script-name.patch (862 bytes ) - added by Mark Rowe <edgewall.com@…> 19 years ago.
Patch that calculates the path to Trac based on REQUEST_URI, QUERY_STRING and PATH_INFO. When REQUEST_URI is not available (I believe this is the case for IIS on Windows), fall back to SCRIPT_NAME. Tested with Apache 2 and lighttpd.

Download all attachments as: .zip

Change History (4)

by Mark Rowe <edgewall.com@…>, 19 years ago

Attachment: trac-script-name.patch added

Patch that calculates the path to Trac based on REQUEST_URI, QUERY_STRING and PATH_INFO. When REQUEST_URI is not available (I believe this is the case for IIS on Windows), fall back to SCRIPT_NAME. Tested with Apache 2 and lighttpd.

comment:1 by Christopher Lenz, 19 years ago

Arguable, this is a lighttpd problem. Also, REQUEST_URI isn't officially part of the [CGI specification http://www.faqs.org/rfcs/rfc3875.html].

comment:2 by Mark Rowe, 19 years ago

I took this up with the lighttpd developer, and he said that their interpretation was valid according to the specification. A glance at the CGI spec shows that it is vague on the semantics of SCRIPT_NAME so that appears to be true. As you noted though, the only work-around requires relying on a non-standard variable.

I agree that it would be preferable to convince lighttpd to bring it's interpretation of SCRIPT_NAME into line with Apache's, but in the mean time don't see this patch causing any problems as it will fall back to the current behaviour if REQUEST_URI isn't available.

comment:3 by Mark Rowe, 19 years ago

Resolution: wontfix
Status: newclosed

I have reached the conclusion that this is a lighttpd issue. Users wishing to use lighttpd with Trac should apply the attached patch, and contact the lighttpd developers to raise their awareness of this issue.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.