aboutsummaryrefslogtreecommitdiff
path: root/src/utils/http.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-07-08 12:54:06 +0100
committerGravatar jesopo2019-07-08 12:54:06 +0100
commit078681eddffb3a29b3136ad12ec01bfa25870124 (patch)
treeefa29615c6ec5b7cd9105167e7924c1358a0070e /src/utils/http.py
parentswitch rss.py to use utils.http.request_many (diff)
signature
add missing schema in utils.http.sanitise_url, use in rss.py
Diffstat (limited to 'src/utils/http.py')
-rw-r--r--src/utils/http.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/http.py b/src/utils/http.py
index 6ee7fdc3..531c24fc 100644
--- a/src/utils/http.py
+++ b/src/utils/http.py
@@ -9,6 +9,9 @@ REGEX_URL = re.compile("https?://[A-Z0-9{}]+".format(re.escape("-._~:/%?#[]@!$&'
# best-effort tidying up of URLs
def url_sanitise(url: str):
+ if not urllib.parse.urlparse(url).scheme:
+ url = "http://%s" % url
+
if url.endswith(")"):
# trim ")" from the end only if there's not a "(" to match it
# google.com/) -> google.com/