- Timestamp:
- Mar 27, 2010, 6:11:31 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/locker-dev/locker/deploy/trac/trac.fcgi
r1527 r1528 3 3 import os, os.path, sys 4 4 from trac.web import fcgi_frontend 5 import urlparse 5 6 6 7 env_path = os.getcwd()+'/tracdata' … … 47 48 and environ['REDIRECT_URL'].endswith(environ['PATH_INFO'])): 48 49 environ['SCRIPT_NAME'] = environ['REDIRECT_URL'][:-len(environ['PATH_INFO'])] 50 51 # If the referrer has our hostname and path, rewrite it to have 52 # the right protocol and port, too. This lets the login link go 53 # to the right page. 54 if 'HTTP_REFERER' in environ: 55 referrer = urlparse.urlsplit(environ['HTTP_REFERER']) 56 base = urlparse.urlsplit( 57 ('https://' if environ.get('HTTPS') == 'on' else 'http://') + 58 environ['HTTP_HOST'] + 59 environ['SCRIPT_NAME']) 60 if referrer.hostname == base.hostname and \ 61 (referrer.path == base.path or 62 referrer.path.startswith(base.path + '/')): 63 environ['HTTP_REFERER'] = urlparse.urlunsplit( 64 (base.scheme, base.netloc, 65 referrer.path, referrer.query, referrer.fragment)) 66 49 67 return fcgi_frontend.dispatch_request(environ, start_response) 50 68
Note: See TracChangeset
for help on using the changeset viewer.