@@ -123,7 +123,7 @@ public String get() {
123123 try {
124124 URL url = URIBuilder .newBuilder ()
125125 .scheme ("http" )
126- .host (InetAddress .getLocalHost ())
126+ .host (InetAddress .getLoopbackAddress ())
127127 .port (server .getAddress ().getPort ())
128128 .path ("/" + connectionId )
129129 .toURL ();
@@ -154,7 +154,7 @@ public String get() {
154154 try {
155155 URL url = URIBuilder .newBuilder ()
156156 .scheme ("http" )
157- .host (InetAddress .getLocalHost ())
157+ .host (InetAddress .getLoopbackAddress ())
158158 .port (server .getAddress ().getPort ())
159159 .path ("/" + connectionId )
160160 .toURL ();
@@ -173,7 +173,7 @@ public String get() {
173173 public static void initialize () {
174174 // start server
175175 try {
176- server = HttpServer .create (new InetSocketAddress (InetAddress .getLocalHost (), 0 ), 10 , "/" , new TestConnectionIDFeature .TestHttpHandler ());
176+ server = HttpServer .create (new InetSocketAddress (InetAddress .getLoopbackAddress (), 0 ), 10 , "/" , new TestConnectionIDFeature .TestHttpHandler ());
177177 } catch (IOException e ) {
178178 throw new RuntimeException ("Could not create server" , e );
179179 }
@@ -200,7 +200,7 @@ public static void runRequests() {
200200 // run second batch of requests where we expect that connections be reused
201201 clientFutures .clear ();
202202 while (connectionIds .peek () != null ) {
203- clientFutures .add (CompletableFuture .supplyAsync (new InitialRequest (connectionIds .pop ()), executor ));
203+ clientFutures .add (CompletableFuture .supplyAsync (new SecondRequest (connectionIds .pop ()), executor ));
204204 }
205205 for (var future : clientFutures ) {
206206 connectionIds .push (future .join ());
0 commit comments