Allow avoidance of the Apache mod_rewrite undo.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7992 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-07-19 19:32:12 +00:00
parent b653cdcfb2
commit 99bbaa0090
1 changed files with 6 additions and 5 deletions

View File

@ -182,10 +182,11 @@ def get_script_name(environ):
Note: this isn't used by the mod_python handler, since the equivalent of
SCRIPT_NAME isn't available there.
"""
# If mod_rewrite had a whack at the URL, Apache set SCRIPT_URL to
# SCRIPT_NAME before applying any rewrites.
script_url = force_unicode(environ.get('SCRIPT_URL', ''))
if script_url:
return script_url
if not environ.get('DJANGO_USE_POST_REWRITE'):
# If mod_rewrite had a whack at the URL, Apache set SCRIPT_URL to
# SCRIPT_NAME before applying any rewrites.
script_url = force_unicode(environ.get('SCRIPT_URL', ''))
if script_url:
return script_url
return force_unicode(environ.get('SCRIPT_NAME', ''))