Skip to content

fix: strip trailing slash from COREPACK_NPM_REGISTRY#871

Open
bitpshr wants to merge 1 commit into
nodejs:mainfrom
bitpshr:fix/registry-trailing-slash
Open

fix: strip trailing slash from COREPACK_NPM_REGISTRY#871
bitpshr wants to merge 1 commit into
nodejs:mainfrom
bitpshr:fix/registry-trailing-slash

Conversation

@bitpshr

@bitpshr bitpshr commented Jul 12, 2026

Copy link
Copy Markdown

Fixes #711.

A COREPACK_NPM_REGISTRY with a trailing slash produced request URLs with a double slash (e.g. https://registry.npmjs.org//pnpm), which some registries like registry.npmmirror.com reject with a 404. Normalize the registry URL by stripping trailing slashes before building request URLs. Added a regression test.

A `COREPACK_NPM_REGISTRY` value with a trailing slash produced request
URLs with a double slash (e.g. `https://registry.npmjs.org//pnpm`).
registry.npmjs.org tolerates this, but some registries such as
registry.npmmirror.com reject it with a 404. Normalize the registry URL
by removing trailing slashes before building request URLs.

Fixes: nodejs#711
Signed-off-by: Paul Bouchon <mail@bitpshr.net>
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.

Requests with double slash using trailing slash (/) in COREPACK_NPM_REGISTRY

1 participant