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

Handle '@' in username #457

Merged
merged 1 commit into from
Oct 27, 2020
Merged

Handle '@' in username #457

merged 1 commit into from
Oct 27, 2020

Conversation

ablyes
Copy link
Contributor

@ablyes ablyes commented Sep 22, 2020

handle the case where the username contains one or more '@' char (like an email address used as username).

handle the case where the username contains one or more '@' char (like an email address used as username).
@googlebot
Copy link

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 @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

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 @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@ablyes
Copy link
Contributor Author

ablyes commented Sep 22, 2020

@googlebot I signed it!

@googlebot
Copy link

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)
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Member

@jin jin left a 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?

@ablyes
Copy link
Contributor Author

ablyes commented Sep 24, 2020

Yes, I will do that.
May be just delete the none realistic tests also.

@jin jin self-assigned this Oct 21, 2020
Copy link
Collaborator

@shs96c shs96c left a 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!

@shs96c shs96c merged commit 501451a into bazelbuild:master Oct 27, 2020
@jin jin mentioned this pull request Jan 6, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants