-
Notifications
You must be signed in to change notification settings - Fork 238
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
Handle '@' in username #457
Conversation
handle the case where the username contains one or more '@' char (like an email address used as username).
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI there are some split_url() tests that have weird urls that this probably won't work for. Not sure if those are real cases somebody has, or not.
https://github.com/bazelbuild/rules_jvm_external/blob/master/tests/unit/coursier_test.bzl#L208
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not realistic to have a host with @
My commit should fix those 2 cases:
username@whatever.com:password@host
username@whatever.com@itLikes@icanputanotheronehere@:password_with_@_why_not:host
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I don't think having that @ char in the path, in unencoded form, is even legal. But just FYI someone thought it was a valid use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add tests?
Yes, I will do that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense. Thank you for the PR!
handle the case where the username contains one or more '@' char (like an email address used as username).