Ticket #17133: django_script_path.patch
File django_script_path.patch, 710 bytes (added by , 12 years ago) |
---|
-
django/core/handlers/base.py
old new 227 227 response = func(request, response) 228 228 return response 229 229 230 import re 231 _multislash = re.compile(r'/+') 232 230 233 def get_script_name(environ): 231 234 """ 232 235 Returns the equivalent of the HTTP request's SCRIPT_NAME environment … … 248 251 if not script_url: 249 252 script_url = environ.get('REDIRECT_URL', u'') 250 253 if script_url: 254 script_url = _multislash.sub("/", script_url) 251 255 return force_unicode(script_url[:-len(environ.get('PATH_INFO', ''))]) 252 256 return force_unicode(environ.get('SCRIPT_NAME', u''))