RFR 8163561, add a test for Proxy Authentication in HTTP/2 Client API
Chris Hegarty
chris.hegarty at oracle.com
Thu Aug 18 15:43:16 UTC 2016
On 18 Aug 2016, at 10:26, Felix Yang <felix.yang at oracle.com> wrote:
>
> Hi all,
>
> please review a new test, which tries to verify "Proxy-Authenticate" header can be handled correctly.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8163561
>
> Webrev: http://cr.openjdk.java.net/~xiaofeya/8163561/webrev.00/
Thank you Felix, this mainly looks good. Just some small comments:
1) You do not need the serverReady latch. Once MyProxy is created it is ok
for the client to initiate a connection before the thread has started running.
The ServerSocket is already created and listening.
2) authLatch could be replaced with a volatile boolean, since the authenticator
is guaranteed ( if there is no bug ) to be called before the CompletableFuture
of HttpResponse.
3) In MyProxy please line up the AutoCloseables underneath each other.
4) Authenticator.setDefault(auth); is not needed, right?
-Chris.
More information about the net-dev
mailing list