Skip to content

Commit 74184d8

Browse files
victor-perezaduh95
andauthored
Update sources/httpUtils.ts
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent cc952d3 commit 74184d8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sources/httpUtils.ts

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

32-
const registry = new URL(process.env.COREPACK_NPM_REGISTRY || DEFAULT_NPM_REGISTRY_URL);
32+
const registry = process.env.COREPACK_NPM_TOKEN && new URL(process.env.COREPACK_NPM_REGISTRY || DEFAULT_NPM_REGISTRY_URL);
3333

34-
if (input.origin === registry.origin && process.env.COREPACK_NPM_TOKEN) {
34+
if (registry && input.origin === registry.origin) {
3535
headers = {
3636
...headers,
3737
authorization: `Bearer ${process.env.COREPACK_NPM_TOKEN}`,

0 commit comments

Comments
 (0)