Skip to content

Commit

Permalink
fix(core): conditionally include hostname parameter when using… (#9407
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jack-robson committed Jan 18, 2024
1 parent f794559 commit bed11f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/docusaurus/src/server/getHostPort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ async function choosePort(
defaultPort: number,
): Promise<number | null> {
try {
const port = await detect({port: defaultPort, hostname: host});
const port = await detect({
port: defaultPort,
...(host !== 'localhost' && {hostname: host}),
});
if (port === defaultPort) {
return port;
}
Expand Down

0 comments on commit bed11f6

Please sign in to comment.