From bed11f62bce0632fc0b227ceeb9d2025323c4004 Mon Sep 17 00:00:00 2001 From: Jack Robson <143492403+jack-robson@users.noreply.github.com> Date: Thu, 18 Jan 2024 13:03:45 +0000 Subject: [PATCH] =?UTF-8?q?fix(core):=20conditionally=20include=20`hostnam?= =?UTF-8?q?e`=20parameter=20when=20using=E2=80=A6=20(#9407)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/docusaurus/src/server/getHostPort.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus/src/server/getHostPort.ts b/packages/docusaurus/src/server/getHostPort.ts index 4ae80708704f..893f754d46ea 100644 --- a/packages/docusaurus/src/server/getHostPort.ts +++ b/packages/docusaurus/src/server/getHostPort.ts @@ -54,7 +54,10 @@ async function choosePort( defaultPort: number, ): Promise { try { - const port = await detect({port: defaultPort, hostname: host}); + const port = await detect({ + port: defaultPort, + ...(host !== 'localhost' && {hostname: host}), + }); if (port === defaultPort) { return port; }