Skip to content

Commit

Permalink
fix: Strip trailing slash for repo url (bazelbuild#2495)
Browse files Browse the repository at this point in the history
Strip potential trailing slash when building url on the case of relative
path without up-references. In particular, this fixes using
`experimental_index_url` with a AWS CodeArtifact python repository,
which currently fails package downloads due to an incorrect URL (with
double `//`) being produced by this code.

Co-authored-by: Richard Levasseur <[email protected]>
  • Loading branch information
amartani and rickeylev authored Dec 11, 2024
1 parent 444ca88 commit e823657
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/private/pypi/parse_simpleapi_html.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ def _absolute_url(index_url, candidate):
return "{}/{}".format(index_url, last.strip("/"))

# relative path without up-references
return "{}/{}".format(index_url, candidate)
return "{}/{}".format(index_url.rstrip("/"), candidate)

0 comments on commit e823657

Please sign in to comment.