Code

Ticket #8490: wsgi_r11339.diff

File wsgi_r11339.diff, 1.1 KB (added by qingfeng, 5 years ago)
Line 
1Index: django/core/handlers/wsgi.py
2===================================================================
3--- django/core/handlers/wsgi.py        (revision 11339)
4+++ django/core/handlers/wsgi.py        (working copy)
5@@ -76,7 +76,7 @@
6     def __init__(self, environ):
7         script_name = base.get_script_name(environ)
8         path_info = force_unicode(environ.get('PATH_INFO', u'/'))
9-        if not path_info or path_info == script_name:
10+        if not path_info:
11             # Sometimes PATH_INFO exists, but is empty (e.g. accessing
12             # the SCRIPT_NAME URL without a trailing slash). We really need to
13             # operate as if they'd requested '/'. Not amazingly nice to force
14@@ -84,7 +84,9 @@
15             #
16             # (The comparison of path_info to script_name is to work around an
17             # apparent bug in flup 1.0.1. Se Django ticket #8490).
18-            path_info = u'/'
19+           path_info = u'/'
20+       if path_info == script_name:
21+           script_name = u''
22         self.environ = environ
23         self.path_info = path_info
24         self.path = '%s%s' % (script_name, path_info)