summaryrefslogtreecommitdiff
path: root/tests/test_httpserver.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_httpserver.py')
-rw-r--r--tests/test_httpserver.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_httpserver.py b/tests/test_httpserver.py
index a719788..3d72c79 100644
--- a/tests/test_httpserver.py
+++ b/tests/test_httpserver.py
@@ -27,3 +27,19 @@ def test_environ():
wsgi_handler.wsgi_setup()
assert wsgi_handler.wsgi_environ['HTTP_HOST'] == 'mywebsite'
+
+
+def test_environ_with_multiple_values():
+ mock_socket = MockSocket()
+ mock_client_address = '1.2.3.4'
+ mock_server = MockServer()
+
+ wsgi_handler = WSGIHandler(mock_socket, mock_client_address, mock_server)
+ wsgi_handler.command = 'GET'
+ wsgi_handler.path = '/path'
+ wsgi_handler.request_version = 'HTTP/1.0'
+ wsgi_handler.headers = email.message_from_string('Host: host1\nHost: host2')
+
+ wsgi_handler.wsgi_setup()
+
+ assert wsgi_handler.wsgi_environ['HTTP_HOST'] == 'host1,host2'