From 1778e117f77b9e7741563a3d8b84e6fb0e000e15 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Wed, 26 May 2021 16:51:55 +0200 Subject: [PATCH] fix(port-forwarding): on WebKit Win (#6745) --- src/utils/utils.ts | 10 +++++++++- tests/portForwardingServer.spec.ts | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index ebb60081f0..919ec8604b 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -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); } diff --git a/tests/portForwardingServer.spec.ts b/tests/portForwardingServer.spec.ts index 5bfee8f295..eac3413d23 100644 --- a/tests/portForwardingServer.spec.ts +++ b/tests/portForwardingServer.spec.ts @@ -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;