diff --git a/src/run.test.ts b/src/run.test.ts index 51bca3f..384edc7 100644 --- a/src/run.test.ts +++ b/src/run.test.ts @@ -664,8 +664,9 @@ describe('run.ts', () => { stubDownloadChain() inputs('3.14', '', '', 'https://fallback.tld') vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => { - const url = String(input) - if (url.startsWith(downloadBaseURL)) { + const requestUrl = new URL(String(input)) + const primaryBaseUrl = new URL(downloadBaseURL) + if (requestUrl.origin === primaryBaseUrl.origin) { throw new Error('Primary unavailable') } return {