RFR: 8352431: java/net/httpclient/EmptyAuthenticate.java uses "localhost"

Jaikiran Pai jpai at openjdk.org
Wed Apr 9 12:18:41 UTC 2025


On Wed, 9 Apr 2025 12:06:23 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> I'm guessing that this test passes for you locally. If so, then we might need some additional investigation here as to why it passes (given the exact opposite assertion of what the test was previously asserting).
>> 
>> I see that the original test was using lower case response header in the server handler and on the client side the test was reading a upper case response header. In this updated version, we use the upper case header consistently in both the handler and the client. You might want to check the original issue https://bugs.openjdk.org/browse/JDK-8263899 to see if the case of the header was playing a role in this test.
>
> firstValue(name) returns an Optional, so we were just testing that the Optional was not empty :-).
> Now we're additionally checking that the value is the empty string.

That explains it :) The method chaining and the same name `isEmpty()` in the original test didn't help me notice that it was checking an `Optional`. Thank you Daniel.

What Volkan has in the updated version looks fine then.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24542#discussion_r2035241063


More information about the net-dev mailing list