Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Artiom N. committed Apr 27, 2024
1 parent a4ba842 commit 6dcd680
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions markdown_toolset/www_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def is_url(url: str, allowed_url_prefixes=('http', 'ftp', 'https', 'ftps')) -> b
"""
Check url for prefix match.
"""

l_url = url.lower()
for prefix in set(allowed_url_prefixes):
if l_url.startswith(prefix.lower()):
Expand All @@ -42,6 +41,7 @@ def remove_protocol_prefix(url: str) -> str:
def download_from_url(url: str, timeout: float = None):
"""
Download file from the URL.
:param url: URL to download.
:param timeout: timeout before fail.
:raise OSError: when HTTP status is not 200.
Expand Down Expand Up @@ -111,7 +111,6 @@ def get_base_url(req: requests.Response) -> Optional[str]:
"""
Get base URL from url.
"""

if req and req.url.find('/'):
return req.url.rsplit('/', 1)[0]

Expand Down

0 comments on commit 6dcd680

Please sign in to comment.