Skip to content

Commit

Permalink
Fix broken upper-casing in wsgi support #1197
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Sep 22, 2016
1 parent 2d69310 commit b782139
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 2 additions & 5 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CHANGES
=======

1.0.2 (XXXX-XX-XX)
1.0.2 (2016-09-22)
------------------

- Make CookieJar compatible with 32-bit systems #1188
Expand All @@ -10,11 +10,8 @@ CHANGES

- Fix `CookieJar` ctor when called with `loop=None` #1203

-
- Fix broken upper-casing in wsgi support #1197

-

-

1.0.1 (2016-09-16)
------------------
Expand Down
1 change: 1 addition & 0 deletions aiohttp/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def create_wsgi_environ(self, message, payload):
script_name = self.SCRIPT_NAME

for hdr_name, hdr_value in message.headers.items():
hdr_name = hdr_name.upper()
if hdr_name == 'SCRIPT_NAME':
script_name = hdr_value
elif hdr_name == 'CONTENT-TYPE':
Expand Down
6 changes: 4 additions & 2 deletions tests/test_wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import unittest
from unittest import mock

import multidict
import aiohttp
from aiohttp import helpers, multidict, protocol, wsgi
from aiohttp import helpers, protocol, wsgi


class TestHttpWsgiServerProtocol(unittest.TestCase):
Expand All @@ -26,7 +27,7 @@ def setUp(self):
('1.2.3.4', 1234),
('2.3.4.5', 80)]

self.headers = multidict.MultiDict({"HOST": "python.org"})
self.headers = multidict.CIMultiDict({"HOST": "python.org"})
self.raw_headers = [(b"HOST", b"python.org")]
self.message = protocol.RawRequestMessage(
'GET', '/path', (1, 0), self.headers, self.raw_headers,
Expand Down Expand Up @@ -73,6 +74,7 @@ def test_environ_headers(self):
('X_TEST', '123'),
('X_TEST', '456')))
environ = self._make_one()
print(environ)
self.assertEqual(environ['CONTENT_TYPE'], 'text/plain')
self.assertEqual(environ['CONTENT_LENGTH'], '209')
self.assertEqual(environ['HTTP_X_TEST'], '123,456')
Expand Down

0 comments on commit b782139

Please sign in to comment.