mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
test: sanitize url hostname check (#19053)
This commit is contained in:
parent
ebc887021e
commit
0e2d641813
@ -149,7 +149,7 @@ function mockRpcCall({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* @ts-expect-error The types for Nock do not include `basePath` in the interface for Nock.Scope. */
|
/* @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}`
|
? `/v3/${MOCK_INFURA_PROJECT_ID}`
|
||||||
: '/';
|
: '/';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user