requests: Added support for some non-standard URLs

pull/751/head
PermissionDenied7335 2023-10-19 08:24:25 +08:00
rodzic e025c843b6
commit 27e00b6274
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -69,6 +69,14 @@ def request(
else:
raise ValueError("Unsupported protocol: " + proto)
if "?" in host:
host, _path = host.split("?", 1)
path = "?" + _path + path
if "#" in host:
host, _path = host.split("#", 1)
path = "#" + _path + path
if ":" in host:
host, port = host.split(":", 1)
port = int(port)