[utils] Fix get_domain

Bug in ae61d108dd

Closes #4344
This commit is contained in:
pukkandan 2022-07-13 19:42:52 +05:30
parent cbd4f237b4
commit ebf99aaf70
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39

View File

@ -2405,7 +2405,11 @@ def remove_quotes(s):
def get_domain(url):
return '.'.join(urllib.parse.urlparse(url).netloc.rsplit('.', 2)[-2:])
"""
This implementation is inconsistent, but is kept for compatibility.
Use this only for "webpage_url_domain"
"""
return remove_start(urllib.parse.urlparse(url).netloc, 'www.') or None
def url_basename(url):