Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: print resolved host in the http server terminal (#30677)

Pavel Feldman979233e48397
diff --git a/packages/playwright-core/src/utils/httpServer.ts b/packages/playwright-core/src/utils/httpServer.ts
index 32012e6f96..f387cefaa8 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;