mirror of
https://seed.radicle.dev/rad:z4D5UCArafTzTQpDZNQRuqswh3ury.git
synced 2026-10-18 19:10:45 +08:00
Don't abort blob URLs in e2e tests
The remote request guard read the empty hostname of a `blob:` URL as remote, so embed previews never loaded in tests.
This commit is contained in:
@@ -79,7 +79,12 @@ export const test = base.extend<{
|
||||
const playwrightLabel =
|
||||
" ".repeat(23) + "→ " + chalk.yellowBright("playwright") + ": ";
|
||||
|
||||
function isLocalhost(url: URL) {
|
||||
function isLocalhost(url: URL): boolean {
|
||||
// A blob URL has no hostname of its own; it belongs to the origin
|
||||
// that created it.
|
||||
if (url.protocol === "blob:") {
|
||||
return isLocalhost(new URL(url.pathname));
|
||||
}
|
||||
return url.hostname === "localhost" || url.hostname === "127.0.0.1";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user