summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Huot <jonathan.huot@gmail.com>2022-09-02 23:22:17 +0200
committerJonathan Huot <jonathan.huot@gmail.com>2022-09-02 23:22:17 +0200
commite514826eea15f2b62bbc13da407b71552ef5ff4c (patch)
treec35f60600279d61056e02be269dd2db9f91a64d1
parent0adbbe10ed8ef822d1c780987fffc56670ce3f9f (diff)
downloadoauthlib-e514826eea15f2b62bbc13da407b71552ef5ff4c.tar.gz
Add check of performance of ipv6 check
-rw-r--r--tests/test_uri_validate.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_uri_validate.py b/tests/test_uri_validate.py
index 3489d95..1ef8b1f 100644
--- a/tests/test_uri_validate.py
+++ b/tests/test_uri_validate.py
@@ -31,3 +31,11 @@ class UriValidateTest(TestCase):
self.assertIsNone(is_absolute_uri('wrong'))
self.assertIsNone(is_absolute_uri('http://[:1]:38432/path'))
self.assertIsNone(is_absolute_uri('http://[abcd:efgh::1]/'))
+
+ def test_recursive_regex(self):
+ from datetime import datetime
+ t0 = datetime.now()
+ self.assertIsNone(is_absolute_uri('http://[::::::::::::::::::::::::::]/path'))
+ t1 = datetime.now()
+ spent = t1 - t0
+ self.assertGreater(0.1, spent.total_seconds(), "possible recursive loop detected")