Skip to content

Commit e514826

Browse files
committed
Add check of performance of ipv6 check
1 parent 0adbbe1 commit e514826

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_uri_validate.py

+8
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,11 @@ def test_is_absolute_uri(self):
3131
self.assertIsNone(is_absolute_uri('wrong'))
3232
self.assertIsNone(is_absolute_uri('http://[:1]:38432/path'))
3333
self.assertIsNone(is_absolute_uri('http://[abcd:efgh::1]/'))
34+
35+
def test_recursive_regex(self):
36+
from datetime import datetime
37+
t0 = datetime.now()
38+
self.assertIsNone(is_absolute_uri('http://[::::::::::::::::::::::::::]/path'))
39+
t1 = datetime.now()
40+
spent = t1 - t0
41+
self.assertGreater(0.1, spent.total_seconds(), "possible recursive loop detected")

0 commit comments

Comments
 (0)