summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_http.py
diff options
context:
space:
mode:
authorAndreas Hug <andreas.hug@moccu.com>2018-07-24 16:18:17 -0400
committerTim Graham <timograham@gmail.com>2018-07-25 12:13:03 -0400
commitd6eaee092709aad477a9894598496c6deec532ff (patch)
tree1b0a5d386ed8b6915cd3507bc2665ded4f3beb3d /tests/utils_tests/test_http.py
parent4fd1f6702aaa9ca9b9918dbdb79546557a00d331 (diff)
[1.11.x] Fixed CVE-2018-14574 -- Fixed open redirect possibility in CommonMiddleware.
Diffstat (limited to 'tests/utils_tests/test_http.py')
-rw-r--r--tests/utils_tests/test_http.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py
index b435e33e44..d339e8a79c 100644
--- a/tests/utils_tests/test_http.py
+++ b/tests/utils_tests/test_http.py
@@ -248,3 +248,13 @@ class HttpDateProcessingTests(unittest.TestCase):
def test_parsing_asctime(self):
parsed = http.parse_http_date('Sun Nov 6 08:49:37 1994')
self.assertEqual(datetime.utcfromtimestamp(parsed), datetime(1994, 11, 6, 8, 49, 37))
+
+
+class EscapeLeadingSlashesTests(unittest.TestCase):
+ def test(self):
+ tests = (
+ ('//example.com', '/%2Fexample.com'),
+ ('//', '/%2F'),
+ )
+ for url, expected in tests:
+ self.assertEqual(http.escape_leading_slashes(url), expected)