Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#4767 closed enhancement (wontfix)

Trac doesn't alow the addition of trailing slashes.

Reported by: nslater@… Owned by: Christopher Lenz
Priority: low Milestone:
Component: web frontend/mod_python Version:
Severity: trivial Keywords: helpwanted
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I wish to append a trailing slash to all request on my Trac installation but this causes Trac to baulk.

I have tried to change things with mod_rewrite but have failed.

After digging around in the code I found that the WSGIRequestHandler is reading the raw request line and hence I cannot fool Trac with environment variables or local URI rewriting.

The only solution to this that I can see is to add a configuration option to Trac much like Djangos APPEND_SLASH that lets you control if the request line is to ignore (strip) trailing slashes.

Attachments (0)

Change History (4)

comment:1 by Matthew Good, 18 years ago

Keywords: needinfo added

Can you explain why you want/need to do this? Trac allows for URLs with trailing slashes when appropriate, but I don't see a reason to have them appended to every request. Also, I'm pretty sure WSGIRequestHandler is not actually involved in the processing of mod_python requests. It's used as part of tracd for parsing the HTTP request.

comment:2 by anonymous, 18 years ago

The rest of my domain uses trailing "/" characters at the end of URLs. I would like to keep with this president for consistency and aesthetics.

You are correct about WSGIRequestHandler, I was looking in the wrong place. I believe there is a function called dispatch_foo or something which handles all the requests. All it would take to implement a fix for this would be to honour the REQUEST_PATH environment variable.

You can set this variable with mod_rewrite and would allow Apache to rewrite Tracs URI namespace.

in reply to:  2 comment:3 by Matthew Good, 18 years ago

Keywords: helpwanted added; needinfo removed
Priority: normallow
Severity: normaltrivial
Type: defectenhancement

Replying to anonymous:

All it would take to implement a fix for this would be to honour the REQUEST_PATH environment variable.

Care to provide a patch? I don't see any reference to REQUEST_PATH in the Apache documentation. Be aware that for #2299 the SCRIPT_URL variable is now read to determine the URL path before rewriting.

comment:4 by nslater@…, 18 years ago

Resolution: wontfix
Status: newclosed

I have changed my mind on this now. Unless there was a way to configure Trac to actually link to URIs with a trailing slash there would be a permanent redirect issued and two requests generated for every single resource request. I am closing as wontfix, if you don't mind.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz 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.