Ticket #11903: bug11903.patch
File bug11903.patch, 1.7 KB (added by , 15 years ago) |
---|
-
django/core/handlers/wsgi.py
11 11 from django.core.urlresolvers import set_script_prefix 12 12 from django.utils import datastructures 13 13 from django.utils.encoding import force_unicode, iri_to_uri 14 from django.utils.http import urlquote 14 15 15 16 # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 16 17 STATUS_CODE_TEXT = { … … 87 88 path_info = u'/' 88 89 self.environ = environ 89 90 self.path_info = path_info 90 self.path = '%s%s' % ( script_name, path_info)91 self.path = '%s%s' % (urlquote(script_name), urlquote(path_info)) 91 92 self.META = environ 92 93 self.META['PATH_INFO'] = path_info 93 94 self.META['SCRIPT_NAME'] = script_name -
tests/regressiontests/bug11903/tests.py
1 from django.core.handlers.wsgi import WSGIRequest 2 from unittest import TestCase 3 4 class TestBug11903(TestCase): 5 6 def testResult(self): 7 wsgi_request = WSGIRequest({'PATH_INFO': '/some special path', 8 'REQUEST_METHOD': 'bogus', 9 'SCRIPT_NAME': u'script'}) 10 self.assertEquals(wsgi_request.path, u'script/some%20special%20path')