Skip to content

Commit 1f140e1

Browse files
committed
fix: registry origin not correct checked
1 parent 490bf98 commit 1f140e1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

sources/httpUtils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ async function fetch(input: string | URL, init?: RequestInit) {
2929
input.username = input.password = ``;
3030
}
3131

32-
if (input.origin === (process.env.COREPACK_NPM_REGISTRY || DEFAULT_NPM_REGISTRY_URL) && process.env.COREPACK_NPM_TOKEN) {
32+
const registry = new URL(process.env.COREPACK_NPM_REGISTRY || DEFAULT_NPM_REGISTRY_URL);
33+
34+
if (input.origin === registry.origin && process.env.COREPACK_NPM_TOKEN) {
3335
headers = {
3436
...headers,
3537
authorization: `Bearer ${process.env.COREPACK_NPM_TOKEN}`,

0 commit comments

Comments
 (0)