Skip to content

Commit 0813710

Browse files
committed
Fix #177: Don't unquote in wsgi.py
1 parent 4b863d3 commit 0813710

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGES
22
=======
33

4+
0.10.2 (11-19-2014)
5+
-------------------
6+
7+
- Don't unquote `environ['PATH_INFO']` in wsgi.py #177
8+
49
0.10.1 (11-17-2014)
510
-------------------
611

aiohttp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This relies on each of the submodules having an __all__ variable.
22

3-
__version__ = '0.10.1'
3+
__version__ = '0.10.2'
44

55

66
from .protocol import * # noqa

aiohttp/wsgi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import os
1515
import sys
1616
import time
17-
from urllib.parse import unquote, urlsplit
17+
from urllib.parse import urlsplit
1818

1919
import aiohttp
2020
from aiohttp import server
@@ -128,7 +128,7 @@ def create_wsgi_environ(self, message, payload):
128128
if script_name:
129129
path_info = path_info.split(script_name, 1)[-1]
130130

131-
environ['PATH_INFO'] = unquote(path_info)
131+
environ['PATH_INFO'] = path_info
132132
environ['SCRIPT_NAME'] = script_name
133133

134134
environ['async.reader'] = self.reader

tests/test_wsgi.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,3 +273,11 @@ def wsgi_app(env, start):
273273
[c[1][0] for c in self.writer.write.mock_calls])
274274
self.assertTrue(content.startswith(b'HTTP/1.0 200 OK'))
275275
self.assertTrue(content.endswith(b'data'))
276+
277+
def test_dont_unquote_environ_path_info(self):
278+
path = '/path/some%20text'
279+
print(path)
280+
self.message = protocol.RawRequestMessage(
281+
'GET', path, (1, 0), self.headers, True, 'deflate')
282+
environ = self._make_one()
283+
self.assertEqual(environ['PATH_INFO'], path)

0 commit comments

Comments
 (0)