Repository navigation
Conversation
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.
With a registry served under a path like
http://localhost:3080/npm/, a lockfile entry for the package namednpmgets its tarball rewritten fromhttps://registry.npmjs.org/npm/-/npm-11.19.1.tgztohttp://localhost:3080/npm/-/npm-11.19.1.tgz, so the fetch 404s. The host-only branch of#registryResolvedskips adding the registry path when the resolved path already starts with it, and/npm/-/...passes that check even though/npmis the package name here. #8737 fixed names that start with the path (npm-run-path) but not an exact match.I kept the "already has the path" check, since
replace-registry-host=alwaysrelies on it when moving between two hosts that share a path (the "registry with path should only swap hostname" test). It's just skipped forregistry.npmjs.org, which never serves under a path, so the path is always added there.Testing
Added a test next to the #8737 one with the registry path equal to the package name and a
registry.npmjs.orgtarball. It fails before the change and passes after. The arborist suite passes locally with full coverage.References
Fixes #10159