Skip to content

Commit

Permalink
make last slash in backup sources urls optional (#14342)
Browse files Browse the repository at this point in the history
  • Loading branch information
memsharded authored Jul 21, 2023
1 parent c3b9ebd commit 0e39b14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions conans/client/downloaders/caching_file_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def _backup_download(self, backup_url, backups_urls, sha256, cached_path, urls,
don't want silently skipping a backup because it is down.
"""
try:
backup_url = backup_url if backup_url.endswith("/") else backup_url + "/"
self._file_downloader.download(backup_url + sha256, cached_path, sha256=sha256)
self._file_downloader.download(backup_url + sha256 + ".json", cached_path + ".json")
self._output.info(f"Sources for {urls} found in remote backup {backup_url}")
Expand Down
4 changes: 2 additions & 2 deletions conans/test/integration/cache/backup_sources_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def source(self):
""")

client.save({"global.conf": f"core.sources:download_cache={download_cache_folder}\n"
f"core.sources:download_urls=['http://localhost:{http_server.port}/downloader/', 'origin']\n"
f"core.sources:upload_url=http://localhost:{http_server.port}/uploader/"},
f"core.sources:download_urls=['http://localhost:{http_server.port}/downloader', 'origin']\n"
f"core.sources:upload_url=http://localhost:{http_server.port}/uploader"},
path=client.cache.cache_folder)

client.save({"conanfile.py": conanfile})
Expand Down

0 comments on commit 0e39b14

Please sign in to comment.