Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: trim trailing '/' on URL if provided in package YAML #45

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions apt/private/package_index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ def _create(rctx, sources, archs):

for arch in archs:
for (url, dist, comp) in sources:
# We assume that `url` does not contain a trailing forward slash when passing to
# functions below. If one is present, remove it. Some HTTP servers do not handle
# redirects properly when a path contains "//"
# (ie. https://mymirror.com/ubuntu//dists/noble/stable/... may return a 404
# on misconfigured HTTP servers)
url = url.rstrip("/")

rctx.report_progress("Fetching package index: {}/{}".format(dist, arch))
(output, _) = _fetch_package_index(rctx, url, dist, comp, arch, "")

Expand Down
Loading
Loading