python: Use urlsplit instead of urlparse.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2023-12-05 12:25:00 -08:00
committed by Tim Abbott
parent 3853fa875a
commit 223b626256
21 changed files with 101 additions and 92 deletions

View File

@@ -2,7 +2,7 @@ from contextlib import suppress
from datetime import timedelta
from decimal import Decimal
from typing import Any, Dict, Iterable, List, Optional, Union
from urllib.parse import urlencode, urlparse
from urllib.parse import urlencode, urlsplit
from django.conf import settings
from django.core.exceptions import ValidationError
@@ -272,7 +272,7 @@ def support(
for key_word in key_words:
try:
URLValidator()(key_word)
parse_result = urlparse(key_word)
parse_result = urlsplit(key_word)
hostname = parse_result.hostname
assert hostname is not None
if parse_result.port: