RFR: 8263899: HttpClient throws NPE in AuthenticationFilter when parsing www-authenticate head

Chris Hegarty chegar at openjdk.java.net
Mon Mar 22 09:43:46 UTC 2021


On Mon, 22 Mar 2021 09:26:08 GMT, Michael McMahon <michaelm at openjdk.org> wrote:

> Could I get the following simple fix reviewed please?
> 
> Thanks,
> Michael.

test/jdk/java/net/httpclient/EmptyAuthenticate.java line 44:

> 42: 
> 43:     public static void main(String[] args) throws IOException, URISyntaxException, InterruptedException {
> 44:         int port = 8000;

I assume that this hardcoded port no. can be removed?

test/jdk/java/net/httpclient/EmptyAuthenticate.java line 51:

> 49:             String response = "test body";
> 50:             exchange.getResponseHeaders().add("www-authenticate", ""); //this empty header will make the HttpClient crash
> 51:             exchange.sendResponseHeaders(401, response.length());

s/crash/throw NPE

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

PR: https://git.openjdk.java.net/jdk/pull/3113


More information about the net-dev mailing list