Skip to content

Commit

Permalink
Update coursier.bzl (#457)
Browse files Browse the repository at this point in the history
handle the case where the username contains one or more '@' char (like an email address used as username).
  • Loading branch information
ablyes committed Oct 27, 2020
1 parent b38b5a4 commit 501451a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion coursier.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ def remove_auth_from_url(url):
host = url_parts[0]
if "@" not in host:
return url
userless_host = host[host.find("@") + 1:]
last_index=host.rfind("@", 0, None)
userless_host=host[last_index + 1:]
new_url = "{}://{}".format(protocol, "/".join([userless_host] + url_parts[1:]))
return new_url

Expand Down

0 comments on commit 501451a

Please sign in to comment.