File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2893,7 +2893,11 @@ class Server {
28932893 }
28942894
28952895 if ( /** @type {NormalizedOpen[] } */ ( this . options . open ) . length > 0 ) {
2896- const openTarget = prettyPrintURL ( this . options . host || "localhost" ) ;
2896+ const openTarget = prettyPrintURL (
2897+ ! this . options . host || this . options . host === "0.0.0.0"
2898+ ? "localhost"
2899+ : this . options . host
2900+ ) ;
28972901
28982902 this . openBrowser ( openTarget ) ;
28992903 }
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ describe('"open" option', () => {
9999 } ) ;
100100 } ) ;
101101
102- it ( "should work with '0.0.0.0' host" , async ( ) => {
102+ it ( "should work with '0.0.0.0' host but open localhost " , async ( ) => {
103103 const host = "0.0.0.0" ;
104104
105105 const server = new Server (
@@ -114,7 +114,7 @@ describe('"open" option', () => {
114114 await server . start ( ) ;
115115 await server . stop ( ) ;
116116
117- expect ( open ) . toHaveBeenCalledWith ( `http://${ host } :${ port } /` , {
117+ expect ( open ) . toHaveBeenCalledWith ( `http://localhost :${ port } /` , {
118118 wait : false ,
119119 } ) ;
120120 } ) ;
You can’t perform that action at this time.
0 commit comments