client: fix image url parsing

This commit is contained in:
2021-03-25 17:56:21 +01:00
parent b37aa33131
commit f15ff38f69
7 changed files with 24 additions and 60 deletions

View File

@@ -245,3 +245,9 @@ def parse_uri(uri: str):
port = 80
return host, port, path
def base_url(uri: str):
parsed = urlsplit(uri)
path = parsed.path.rsplit("/", 1)[0]
return f"{parsed.scheme}://{parsed.hostname}{path}/"