RFR: 8354276: Strict HTTP header validation [v6]

Daniel Fuchs dfuchs at openjdk.org
Wed Apr 30 08:58:47 UTC 2025


On Wed, 30 Apr 2025 08:28:01 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Daniel Jeliński has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Migrate to HttpServerAdapters
>
> 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")`

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

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


More information about the net-dev mailing list