Edgewall Software

Changes between Initial Version and Version 2 of Ticket #7500


Ignore:
Timestamp:
Oct 23, 2008, 11:51:41 PM (16 years ago)
Author:
Remy Blank
Comment:

CGI is being phased out, as it is very inefficient. So yes, I would recommend to patch your local trac.cgi.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7500

    • Property Status newclosed
    • Property Resolutionwontfix
  • Ticket #7500 – Description

    initial v2  
    25251) Modify trac.cgi to work around the bug
    2626This is easy -- add these lines just after the comments but before the big try-catch block:
    27 
     27{{{
    2828import os
    2929if 'SCRIPT_URL' not in os.environ and 'REDIRECT_URL' in os.environ:
    3030    os.environ['SCRIPT_URL'] = os.environ['REDIRECT_URL']
    31 
     31}}}
    32322) The proper fix.
    3333Edit /lib/python*/site-packages/Trac-0.11-py*.egg/trac/web/main.py. Around line 315 you'll see:
     34{{{
    3435script_url = environ.get('SCRIPT_URL')
    3536if script_url is not None:
    36 
     37}}}
    3738Change this to say:
     39{{{
    3840script_url = environ.get('SCRIPT_URL')
    3941if script_url is None:
    4042    script_url = environ.get('REDIRECT_URL')
    4143if script_url is not None:
    42 
     44}}}
    4345Note the two lines I added.
    4446This makes Trac check for SCRIPT_URL first -- if it isn't assigned, then it checks for REDIRECT_URL. This should make it possible for Trac to find out about the mod_rewrite rule and amend the URLs it outputs accordingly.