-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix private urls using colon separator #2519
Conversation
The might not work for some git urls since |
7efb32a
to
28835f4
Compare
Closes yarnpkg#573, closes yarnpkg#2416. Related to yarnpkg#2384, yarnpkg#573.
e1d091e
to
4daef28
Compare
|
||
}); | ||
|
||
test('GitResolver transformUrl affect host colon separated urls', () => { |
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.
Maybe call this 'GitResolver transformUrl replaces the colon on colon separated urls'
?
// This transformUrl util is here to replace colon separators in the pathname | ||
// from private urls. It takes the url parts retrieved using urlFormat and | ||
// returns the associated url. Related to #573, introduced in #2519. | ||
static transformUrl(parts) : string { |
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 we can probably come up with a more descriptive name than "transform."
Nice work, thanks a lot for the tests! |
* Fix private urls using colon separator Closes yarnpkg#573, closes yarnpkg#2416. Related to yarnpkg#2384, yarnpkg#573. * Remove unused suppression * Move to dedicated method & add tests
People were still experiencing issues with private urls using colons as separator even after the fix introduced in #2384.
This fix basically replace the initial pathname part of the parsed url in the git resolver, and reformat exploded parts onto the equivalent url, removing the colon culprit.
Unsure about why the require onto the
url
module is done the old way, I've decided to follow consistency, but can refactor if needed. Related issues referenced in commit.👋 @chrisirhc @lxe