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

Fix slashes handling in registry name #774

Closed
wants to merge 1 commit into from

Conversation

chicoxyzzy
Copy link
Contributor

Summary

Some registry names need trailing slash. So this PR fixes issue described in #606 (comment)

Test plan

yarn

@@ -47,7 +46,7 @@ export default class NpmRegistry extends Registry {
}

request(pathname: string, opts?: RegistryRequestOptions = {}): Promise<?Object> {
const registry = removeSuffix(String(this.registries.yarn.getOption('registry')), '/');
Copy link

@serkanyersen serkanyersen Oct 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of removing this line, it might be better to keep it and change the url.resolve line as

`${registry}/${pathname}`

@chicoxyzzy chicoxyzzy changed the title Don't remove trailing slash from registry name Fix slashes handling in registry name Oct 12, 2016
@cpojer
Copy link
Contributor

cpojer commented Oct 12, 2016

Can you add a test for this behavior?

@chicoxyzzy
Copy link
Contributor Author

Sure. I'll add some tests this evening.

@chicoxyzzy
Copy link
Contributor Author

chicoxyzzy commented Oct 12, 2016

Just noticed there was another PR #712 and it was merged (no tests tho so I'll add them)

@chicoxyzzy chicoxyzzy closed this Oct 12, 2016
@chicoxyzzy chicoxyzzy deleted the dont_remove_slash branch October 12, 2016 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants