On Wed, 30 Apr 2025 08:55:26 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

>> test/jdk/java/net/httpclient/http2/BadPushPromiseTest.java line 87:
>> 
>>> 85:         int port = server.getAddress().getPort();
>>> 86:         System.err.println("Server listening on port " + port);
>>> 87:         uri = new URI("http://localhost:"; + port + "/foo/a/b/c");
>> 
>> Hello Daniel, I think we should avoid `localhost` usage here and instead use 
>> `URIBuilder` test library util and then pass it  
>> `InetAddress.getLoopbackAddress()` as the host. That should help avoid 
>> issues related to `localhost` being mapped to some other address and at the 
>> same time allow constructing the right URL when 
>> `InetAddress.getLoopbackAddress()` returns an IPv6 address.
>
> Ah - good point - you can also simply use `new URI("http://"; + 
> server.serverAuthority() + "/foo/a/b/c")`

Good catch! Switched to `serverAuthority()`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24569#discussion_r2068267507

Reply via email to