RFR: JDK-8282354 : Remove dependancy of TestHttpServer, HttpTransaction, HttpCallback from open/test/jdk/ tests [v3]
Mahendra Chhipa
duke at openjdk.java.net
Fri Mar 4 11:10:05 UTC 2022
On Wed, 2 Mar 2022 12:35:47 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Mahendra Chhipa has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Removed extra whitespace
>
> test/jdk/java/net/URLConnection/B5052093.java line 113:
>
>> 111: exchange.close();
>> 112: } catch (IOException e) {
>> 113: e.printStackTrace();
>
> Are you sure that this results in the same response headers than before?
> If I'm not mistaken here we will send both Content-Length and Transfer-Encoding: chunked. Was that what the previous server did, and what the test wants to test?
Yes, previously also, setting the content-length Integer.MAX_VALUE)) + 2, and was not sending any content. Here wanted to test, that URLConnection.getContentLength() does not throw NumberFormatException and return -1 if content-length is long value.
In case of HttpExchange.setResponseHeader(). If responseLength is -1, then content-length value is overridden to 0, if already set explicitly. Same is the case when responseLength is > 0. Only in the case when responseLength == 0, content-length value is not overriden if already set explicitly., thats why I am using chunked encoding and not writing any data.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7616
More information about the net-dev
mailing list