mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
index: fix GitLab Raw URLs with gitlab.com and recent versions
GitLab seems to be moving to always having "-" as the first path segment in all the project URLs. So the URL without a "-" is now a redirect.
This commit is contained in:
parent
531c36f310
commit
ba854cbc0f
4 changed files with 85 additions and 4 deletions
|
|
@ -648,7 +648,7 @@ def get_mirror_service_urls(url):
|
|||
'''
|
||||
|
||||
if url.startswith('git@'):
|
||||
url = re.sub(r'^git@(.*):(.*)', r'https://\1/\2', url)
|
||||
url = re.sub(r'^git@([^:]+):(.+)', r'https://\1/\2', url)
|
||||
|
||||
segments = url.split("/")
|
||||
|
||||
|
|
@ -676,10 +676,9 @@ def get_mirror_service_urls(url):
|
|||
# Gitlab-like Pages segments "https://user.gitlab.io/repo/folder"
|
||||
gitlab_pages = ["https:", "", user + ".gitlab.io", repo, folder]
|
||||
urls.append('/'.join(gitlab_pages))
|
||||
# Gitlab Raw "https://gitlab.com/user/repo/raw/branch/folder"
|
||||
gitlab_raw = segments + ['raw', branch, folder]
|
||||
# GitLab Raw "https://gitlab.com/user/repo/-/raw/branch/folder"
|
||||
gitlab_raw = segments + ['-', 'raw', branch, folder]
|
||||
urls.append('/'.join(gitlab_raw))
|
||||
return urls
|
||||
|
||||
return urls
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue