RFR: 8274779: HttpURLConnection: HttpClient and HttpsClient incorrectly check request method when set to POST [v3]

Evan Whelan ewhelan at openjdk.java.net
Tue Oct 19 13:48:28 UTC 2021


On Fri, 15 Oct 2021 15:25:33 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Evan Whelan has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Extracted both connectTimeouts to variables and added copyright header to accessor
>>  - Removed reflection in favour of injected accessor for KeepAliveCache
>
> test/jdk/sun/net/www/http/RequestMethodCheck/RequestMethodEquality.java line 96:
> 
>> 94:             Field inCache = HttpClient.class.getDeclaredField("inCache");
>> 95:             inCache.setAccessible(true);
>> 96:             inCache.setBoolean(freshClient, true); // allows the assertion in HttpClient.New to pass
> 
> You can use the HttpClientAccess to get and set this field too, since the field is protected in HttpClient.
> Just add a method:
> 
> public void setInCache(HttpClient client, boolean inCache) { client.inCache = inCache; } 
> 
> to HttpClientAccess.

You're right, made that change! Thanks

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

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


More information about the net-dev mailing list