From dbff517772d0937350e568412b0a83a529a60d33 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Mon, 6 May 2024 10:48:20 -0700 Subject: [PATCH] chore: print resolved host in the http server terminal --- 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;