mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 07:20:29 +03:00
index: make download_repo_index() handle common URL mistakes
This commit is contained in:
parent
a71409815e
commit
5267699d81
2 changed files with 18 additions and 1 deletions
|
|
@ -1072,7 +1072,12 @@ def download_repo_index(url_str, etag=None, verify_fingerprint=True, timeout=600
|
|||
raise VerificationException(_("No fingerprint in URL."))
|
||||
fingerprint = query['fingerprint'][0]
|
||||
|
||||
url = urllib.parse.SplitResult(url.scheme, url.netloc, url.path + '/index-v1.jar', '', '')
|
||||
if url.path.endswith('/index-v1.jar'):
|
||||
path = url.path[:-13].rstrip('/')
|
||||
else:
|
||||
path = url.path.rstrip('/')
|
||||
|
||||
url = urllib.parse.SplitResult(url.scheme, url.netloc, path + '/index-v1.jar', '', '')
|
||||
download, new_etag = net.http_get(url.geturl(), etag, timeout)
|
||||
|
||||
if download is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue