Ticket #8490: 8490.diff

File 8490.diff, 1.1 KB (added by mtrichardson, 7 years ago)

Simple patch which tests to see if path_info equals script_name and, if so, set it to '/'

  • 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:
     79        if not path_info or path_info == script_name:
    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
    8383            # the path like this, but should be harmless.
     84            #
     85            # Other times, path_info erroneously is the same as script_name.
     86            # This occurs on subdirectories in lighttpd accessed without
     87            # a trailing '/' and possibly under other situations.
    8488            path_info = u'/'
    8589        self.environ = environ
    8690        self.path_info = path_info
Back to Top