fix: do not use url.URL to support early node 6 and scp-style URLs#64
Closed
billneff79 wants to merge 1 commit intonpm:legacy-ayfkmfrom
Closed
fix: do not use url.URL to support early node 6 and scp-style URLs#64billneff79 wants to merge 1 commit intonpm:legacy-ayfkmfrom
billneff79 wants to merge 1 commit intonpm:legacy-ayfkmfrom
Conversation
This was referenced Feb 26, 2020
Author
billneff79
commented
Feb 26, 2020
| legacy.auth = whatwg.username || '' | ||
| if (whatwg.password) legacy.auth += ':' + whatwg.password | ||
| // Replace the url decoded username:password with the url encoded username:password from the original url | ||
| legacy.auth = giturl.match(new RegExp('^[^/]+//([^@]+)@'))[1] |
Author
There was a problem hiding this comment.
I originally had more checks here for URLs that did not have a protocol or slashes in it, and then I realized I couldn't test that because a URL without a protocol or slashes will never satisfy legacy.auth being truthy, so I removed them.
Contributor
|
Ah, I'd already landed #62 when I saw this, sorry. I agree, this is a bit of a cleaner fix for legacy v6 node users, but since that node version is only barely supported anyway, I think it's fine either way. Closing this for now, if we get complaints about urlencoding in auth in urls in node v6 less than 6.12, we can revisit it :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This gets rid of using url.URL, which fixes #60 and #61
This in theory could also be applied to the latest branch. While node v6 isn't supported in the latest branch, it may be a more elegant fix to #60 than leaving url.URL in place.