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: npm.org now has a different way to request info about scoped packages #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GerHobbelt
Copy link
Contributor

via the Npm-Scope header. See also https://docs.npmjs.com/misc/registry

Code fixed and works at least for a few of my own scoped packages.

@rarkins
Copy link
Collaborator

rarkins commented Oct 4, 2017

@GerHobbelt thanks for all your contributions. I was a little surprised to see this PR, as I also query scoped packages in my project renovate. I read the npm page, I'm not 100% sure this is the right way to do this, although I can see why it works. The page says:

If your project is scoped, this header will contain its scope.

It doesn't necessarily follow that the correct way to request any scoped package is to use that header - aren't they just warning that if the project you're working on is scoped then that scope will be transmitted to npm?

I wonder for instance if you were to include scope 'a' in the Npm-scope header but the URL was @b%2Fc then would it return @a/c or @b/c.

Anyway in short, I'd like to confirm that this way is preferred over the existing way, as I know the existing way works fine for now.

@GerHobbelt
Copy link
Contributor Author

Ah, I did this because the existing way broke for me: npm rejected the requests.

(After GerHobbelt/jison#11 I changed to using scoped packages, e.g. @gerhobbelt/changelog. Invoking changelog on my changelog copy (@gerhobbelt/changelog) failed immediately, until I moved the code to this new header-based approach. I did test it on a few of these repos of mine but I DID NOT test it on other scoped packages, i.e. scopes done by others.)

…ntly reverted to old behaviour. See also commit SHA-1: 368495e :: fix: npm.org now has a different way to request info about scoped packages: via the `Npm-Scope` header. See also https://docs.npmjs.com/misc/registry
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.

None yet

2 participants