abderrahim commented on code in PR #60:
URL:
https://github.com/apache/buildstream-plugins/pull/60#discussion_r1524604389
##########
src/buildstream_plugins/sources/cargo.py:
##########
@@ -234,9 +233,8 @@ def _download(self, url):
# (str): The URL for this crate
#
def _get_url(self, alias=None):
- url = self.cargo.translate_url(self.cargo.url, alias_override=alias)
path = "{name}/{name}-{version}.crate".format(name=self.name,
version=self.version)
- return urljoin(f"{url}/", path)
+ return self.cargo.translate_url(self.cargo.url, suffix=path,
alias_override=alias)
Review Comment:
Yes and no. The whole `urljoin` dance was supposed to allow specifying the
url with and without the trailing slash.
However if we're working with an "untranslated" url (i.e. with an alias),
then 1. `urljoin` doesn't work and 2. we might be unable to know whether the
url provided has a trailing slash or not. I'm inclined to assume the trailing
slash and not include it.
#52 is where this was changed, and earlier we were assuming the url didn't
include a trailing slash.
So it comes down to determining what we think would be most correct and go
with it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]