コード例 #1
0
ファイル: wsgi.py プロジェクト: zalmoxis/django
def get_path_info(environ):
    """
    Returns the HTTP request's PATH_INFO as a unicode string.
    """
    path_info = get_bytes_from_wsgi(environ, 'PATH_INFO', '/')

    return repercent_broken_unicode(path_info).decode(UTF_8)
コード例 #2
0
ファイル: wsgi.py プロジェクト: nbrayali/django
def get_path_info(environ):
    """
    Returns the HTTP request's PATH_INFO as a unicode string.
    """
    path_info = get_bytes_from_wsgi(environ, 'PATH_INFO', '/')

    return repercent_broken_unicode(path_info).decode(UTF_8)
コード例 #3
0
 def test_repercent_broken_unicode_recursion_error(self):
     # Prepare a string long enough to force a recursion error if the tested
     # function uses recursion.
     data = b'\xfc' * sys.getrecursionlimit()
     try:
         self.assertEqual(repercent_broken_unicode(data), b'%FC' * sys.getrecursionlimit())
     except RecursionError:
         self.fail('Unexpected RecursionError raised.')
コード例 #4
0
def get_path_info(environ):
    """Return the HTTP request's PATH_INFO as a string."""
    path_info = get_bytes_from_wsgi(environ, "PATH_INFO", "/")

    return repercent_broken_unicode(path_info).decode()