RFR: JDK-8282354 : Remove dependancy of TestHttpServer, HttpTransaction, HttpCallback from open/test/jdk/ tests [v3]
Daniel Fuchs
dfuchs at openjdk.java.net
Fri Mar 4 11:25:02 UTC 2022
On Fri, 4 Mar 2022 11:10:40 GMT, Mahendra Chhipa <duke at openjdk.java.net> wrote:
>> test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java line 206:
>>
>>> 204: // override the Content-length header to be greater than the actual response body
>>> 205: trans.getResponseHeaders().set("Content-length", Integer.toString(responseBody.length+1));
>>> 206: trans.sendResponseHeaders(200, 0);
>>
>> Here again we will be mixing Content-Length and chunked
>
> 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., that's why I am using chunked encoding and writing the data less than the content length.
I understand why you do it - but the client will react differently if both Content-Length *and* chunk are specified, as opposed to when only Content-Length is specified. So I just want to make sure that we are testing the same thing than before. If we are not testing the same thing, then you might have to use a ServerSocket directly - rather than an HttpServer, to make sure we're sending back the same things than before.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7616
More information about the net-dev
mailing list