1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

test: sanitize url hostname check (#19053)

This commit is contained in:
legobeat 2023-05-17 15:09:20 +00:00 committed by GitHub
parent ebc887021e
commit 0e2d641813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,7 +149,7 @@ function mockRpcCall({
}
}
/* @ts-expect-error The types for Nock do not include `basePath` in the interface for Nock.Scope. */
const url = nockScope.basePath.includes('infura.io')
const url = new URL(nockScope.basePath).hostname.match(/(\.|^)infura.io$/u)
? `/v3/${MOCK_INFURA_PROJECT_ID}`
: '/';