Skip to content

Commit

Permalink
Treat http:// and https:// as equivalent
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Dec 3, 2024
1 parent 9c124b6 commit b14f855
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
18 changes: 16 additions & 2 deletions constructor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,22 @@ def get_final_url(info, url):
for entry in mapping:
src = entry['src']
dst = entry['dest']
if url.startswith(src):
new_url = url.replace(src, dst)
# Treat http:// and https:// as equivalent
if src.startswith("http"):
srcs = tuple(
dict.fromkeys(
[
src,
src.replace("http://", "https://"),
src.replace("https://", "http://")
]
)
)
else:
srcs = (src,)
if url.startswith(srcs):
for src in srcs:
new_url = url.replace(src, dst)
if url.endswith(".tar.bz2"):
logger.warning("You need to make the package %s available "
"at %s", url.rsplit('/', 1)[1], new_url)
Expand Down
1 change: 0 additions & 1 deletion dev/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ dependencies:
- conda-standalone # >=23.11.0
- pillow >=3.1 # [osx or win]
- jinja2
- conda-libmamba-solver 24.9.*

0 comments on commit b14f855

Please sign in to comment.