Ticket #8490: wsgi_r11339.diff

File wsgi_r11339.diff, 1.1 KB (added by qingfeng, 5 years ago)
  • django/core/handlers/wsgi.py

     
    7676    def __init__(self, environ):
    7777        script_name = base.get_script_name(environ)
    7878        path_info = force_unicode(environ.get('PATH_INFO', u'/'))
    79         if not path_info or path_info == script_name:
     79        if not path_info:
    8080            # Sometimes PATH_INFO exists, but is empty (e.g. accessing
    8181            # the SCRIPT_NAME URL without a trailing slash). We really need to
    8282            # operate as if they'd requested '/'. Not amazingly nice to force
     
    8484            #
    8585            # (The comparison of path_info to script_name is to work around an
    8686            # apparent bug in flup 1.0.1. Se Django ticket #8490).
    87             path_info = u'/'
     87            path_info = u'/'
     88        if path_info == script_name:
     89            script_name = u''
    8890        self.environ = environ
    8991        self.path_info = path_info
    9092        self.path = '%s%s' % (script_name, path_info)
Back to Top