From 27e00b6274eb6744a493d7ab00a527aa2bc0e259 Mon Sep 17 00:00:00 2001 From: PermissionDenied7335 Date: Thu, 19 Oct 2023 08:24:25 +0800 Subject: [PATCH] requests: Added support for some non-standard URLs --- python-ecosys/requests/requests/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python-ecosys/requests/requests/__init__.py b/python-ecosys/requests/requests/__init__.py index fd751e62..b38fc35d 100644 --- a/python-ecosys/requests/requests/__init__.py +++ b/python-ecosys/requests/requests/__init__.py @@ -68,6 +68,14 @@ def request( port = 443 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)