Ticket #17550: 17550.diff

File 17550.diff, 853 bytes (added by Grzegorz Szczepańczyk, 6 years ago)
  • django/core/handlers/wsgi.py

    diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py
    index 2898703..98f1a7f 100644
    a b class WSGIRequest(http.HttpRequest): 
    129129    def __init__(self, environ):
    130130        script_name = base.get_script_name(environ)
    131131        path_info = force_unicode(environ.get('PATH_INFO', u'/'))
    132         if not path_info or path_info == script_name:
     132        naked_request_uri = force_unicode(environ.get('REQUEST_URI', u'/')).split('?')[0]
     133        if not path_info or (path_info == script_name and path_info == naked_request_uri):
    133134            # Sometimes PATH_INFO exists, but is empty (e.g. accessing
    134135            # the SCRIPT_NAME URL without a trailing slash). We really need to
    135136            # operate as if they'd requested '/'. Not amazingly nice to force
Back to Top