Commit d4a12a83 authored by Denis Bilenko's avatar Denis Bilenko

test that wsgi unquotes PATH_INFO

parent 926ffd02
......@@ -412,6 +412,21 @@ class TestHttps(TestCase):
g.kill(block=True)
class TestInternational(TestCase):
def application(self, environ, start_response):
assert environ['PATH_INFO'] == '/\xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82', environ['PATH_INFO']
assert environ['QUERY_STRING'] == '%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81=%D0%BE%D1%82%D0%B2%D0%B5%D1%82', environ['QUERY_STRING']
start_response("200 PASSED", [])
return []
def test(self):
sock = socket.connect_tcp(('127.0.0.1', self.port))
sock.sendall('GET /%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82?%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81=%D0%BE%D1%82%D0%B2%D0%B5%D1%82 HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n')
result = sock.makefile().read()
assert '200 PASSED' in result, result
class HTTPRequest(urllib2.Request):
"""Hack urllib2.Request to support PUT and DELETE methods."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment