diff options
author | Jeff Balogh <me@jeffbalogh.org> | 2010-03-24 20:55:59 (GMT) |
---|---|---|
committer | Jeff Balogh <me@jeffbalogh.org> | 2010-03-24 21:13:28 (GMT) |
commit | 40a730200b7eb641d1b90eb7b04aba41e6c6c9ec (patch) | |
tree | 06ffa8d6e98c4eb30c48fe18be62654cdfeff36c /wsgi | |
parent | b6a0f0fd08a249361c12b3432e3aae1be97f287d (diff) |
force SCRIPT_NAME="" for darklaunch pages (bug 554576)
Diffstat (limited to 'wsgi')
-rw-r--r-- | wsgi/zamboni.wsgi | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/wsgi/zamboni.wsgi b/wsgi/zamboni.wsgi index 0e53a51..31f5422 100644 --- a/wsgi/zamboni.wsgi +++ b/wsgi/zamboni.wsgi @@ -15,7 +15,17 @@ import zamboni.manage os.environ['DJANGO_SETTINGS_MODULE'] = 'zamboni.local_settings' # This is what mod_wsgi runs. -application = django.core.handlers.wsgi.WSGIHandler() +django_app = application = django.core.handlers.wsgi.WSGIHandler() + + +# Normally we could let WSGIHandler run directly, but while we're dark +# launching, we want to force the script name to be empty so we don't create +# any /z links through reverse. This fixes bug 554576. +def application(env, start_response): + if 'HTTP_X_ZEUS_DL_PT' in env: + env['SCRIPT_NAME'] = '' + return django_app(env, start_response) + # Uncomment this to figure out what's going on with the mod_wsgi environment. # def application(env, start_response): |