fix(port-forwarding): on WebKit Win (#6745)

This commit is contained in:
Max Schmitt 2021-05-26 16:51:55 +02:00 committed by GitHub
parent 59d591bce6
commit 1778e117f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -178,6 +178,14 @@ export function canAccessFile(file: string) {
}
}
const localIpAddresses = [
'localhost',
'127.0.0.1',
'::ffff:127.0.0.1',
'::1',
'0000:0000:0000:0000:0000:0000:0000:0001', // WebKit (Windows)
];
export function isLocalIpAddress(ipAdress: string): boolean {
return ['localhost', '127.0.0.1', '::ffff:127.0.0.1', '::1'].includes(ipAdress);
return localIpAddresses.includes(ipAdress);
}

View File

@ -20,6 +20,7 @@ import { contextTest as it, expect } from './config/browserTest';
import type { LaunchOptions, ConnectOptions } from '../index';
it.skip(({ mode }) => mode !== 'default');
it.fixme(({platform, browserName}) => platform === 'darwin' && browserName === 'webkit');
let targetTestServer: http.Server;
let port!: number;