Skip to content

Commit ac971bd

Browse files
committed
fix: replace :: with localhost before openBrowser()
1 parent 99f66cb commit ac971bd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/Server.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -2955,7 +2955,9 @@ class Server {
29552955

29562956
if (/** @type {NormalizedOpen[]} */ (this.options.open).length > 0) {
29572957
const openTarget = prettyPrintURL(
2958-
!this.options.host || this.options.host === "0.0.0.0"
2958+
!this.options.host ||
2959+
this.options.host === "0.0.0.0" ||
2960+
this.options.host === "::"
29592961
? "localhost"
29602962
: this.options.host
29612963
);

test/server/open-option.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ describe('"open" option', () => {
134134
await server.start();
135135
await server.stop();
136136

137-
expect(open).toHaveBeenCalledWith(`http://[${host}]:${port}/`, {
137+
expect(open).toHaveBeenCalledWith(`http://localhost:${port}/`, {
138138
wait: false,
139139
});
140140
});

0 commit comments

Comments
 (0)