From 54c157dec53c5b8718c066aa18da0a2183501e04 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Mon, 6 May 2024 11:07:45 -0700 Subject: [PATCH] =?UTF-8?q?cherry-pick(#30677):=20chore:=20print=20resolve?= =?UTF-8?q?d=20host=20in=20the=20http=20server=20te=E2=80=A6=20(#30679)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …rminal --- packages/playwright-core/src/utils/httpServer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/playwright-core/src/utils/httpServer.ts b/packages/playwright-core/src/utils/httpServer.ts index 32012e6f96d1b..f387cefaa8d49 100644 --- a/packages/playwright-core/src/utils/httpServer.ts +++ b/packages/playwright-core/src/utils/httpServer.ts @@ -126,7 +126,8 @@ export class HttpServer { this._urlPrefix = address; } else { this._port = address.port; - this._urlPrefix = `http://${host}:${address.port}`; + const resolvedHost = address.family === 'IPv4' ? address.address : `[${address.address}]`; + this._urlPrefix = `http://${resolvedHost}:${address.port}`; } } return this._urlPrefix;