Making parse_server_name more consistent (#14007)

Fixes #12122
This commit is contained in:
Abdullah Osama 2022-10-11 14:42:11 +02:00 committed by GitHub
parent 17c031b251
commit a9934d48c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -25,6 +25,8 @@ class ServerNameTestCase(unittest.TestCase):
"[0abc:1def::1234]": ("[0abc:1def::1234]", None),
"1.2.3.4:1": ("1.2.3.4", 1),
"[0abc:1def::1234]:8080": ("[0abc:1def::1234]", 8080),
":80": ("", 80),
"": ("", None),
}
for i, o in test_data.items():
@ -42,6 +44,7 @@ class ServerNameTestCase(unittest.TestCase):
"newline.com\n",
".empty-label.com",
"1234:5678:80", # too many colons
":80",
]
for i in test_data:
try: