summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert JW Regeer <bertjw@regeer.org>2019-01-25 22:20:16 -0700
committerBert JW Regeer <bertjw@regeer.org>2019-01-25 22:20:16 -0700
commitb35285167dcb3ac092fac4dee8a1a48b74552dd3 (patch)
treea94f7ccd72695dfeaacc3359a1864f97f54e7a29
parent00b30a393efafa036ac39e1f8e7b912181086965 (diff)
downloadwaitress-b35285167dcb3ac092fac4dee8a1a48b74552dd3.tar.gz
Update tests to remote brackets from REMOTE_ADDR
-rw-r--r--waitress/tests/test_task.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/waitress/tests/test_task.py b/waitress/tests/test_task.py
index c141d79..23d92dc 100644
--- a/waitress/tests/test_task.py
+++ b/waitress/tests/test_task.py
@@ -989,7 +989,7 @@ class TestWSGITask(unittest.TestCase):
trusted_proxy_headers={'x-forwarded-for'}
)
- self.assertEqual(environ['REMOTE_ADDR'], '[2001:db8::0]')
+ self.assertEqual(environ['REMOTE_ADDR'], '2001:db8::0')
def test_parse_proxy_headers_forwared_for_multiple(self):
inst = self._makeOne()
@@ -1029,7 +1029,7 @@ class TestWSGITask(unittest.TestCase):
inst = self._makeOne()
headers = {
- 'FORWARDED': 'for="[2001:db8::1]";host="example.com:8443";proto="https", for=192.0.2.1;host="example.internal:8080"'
+ 'FORWARDED': 'for="[2001:db8::1]:3821";host="example.com:8443";proto="https", for=192.0.2.1;host="example.internal:8080"'
}
environ = {}
inst.parse_proxy_headers(
@@ -1039,7 +1039,8 @@ class TestWSGITask(unittest.TestCase):
trusted_proxy_headers={'forwarded'}
)
- self.assertEqual(environ['REMOTE_ADDR'], '[2001:db8::1]')
+ self.assertEqual(environ['REMOTE_ADDR'], '2001:db8::1')
+ self.assertEqual(environ['REMOTE_PORT'], '3821')
self.assertEqual(environ['SERVER_NAME'], 'example.com')
self.assertEqual(environ['HTTP_HOST'], 'example.com:8443')
self.assertEqual(environ['SERVER_PORT'], '8443')
@@ -1059,7 +1060,7 @@ class TestWSGITask(unittest.TestCase):
trusted_proxy_headers={'forwarded'}
)
- self.assertEqual(environ['REMOTE_ADDR'], '[2001:db8::1]')
+ self.assertEqual(environ['REMOTE_ADDR'], '2001:db8::1')
self.assertEqual(environ['SERVER_NAME'], 'example.org')
self.assertEqual(environ['HTTP_HOST'], 'example.org')
self.assertEqual(environ['SERVER_PORT'], '443')