Fixes #4764 - HTTP2 Jetty Server does not send back content-length.
Fixed InterleavingTest that was using the wrong MetaData.Response constructor. Fixed handling of HEAD methods in HttpTransportOverHTTP2. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
3e96bf8621
commit
0e30d6b751
|
@ -111,7 +111,7 @@ public class InterleavingTest extends AbstractTest
|
|||
|
||||
Stream serverStream1 = serverStreams.get(0);
|
||||
Stream serverStream2 = serverStreams.get(1);
|
||||
MetaData.Response response1 = new MetaData.Response(HttpVersion.HTTP_2, HttpStatus.OK_200, new HttpFields(), 0);
|
||||
MetaData.Response response1 = new MetaData.Response(HttpVersion.HTTP_2, HttpStatus.OK_200, new HttpFields());
|
||||
serverStream1.headers(new HeadersFrame(serverStream1.getId(), response1, null, false), Callback.NOOP);
|
||||
|
||||
Random random = new Random();
|
||||
|
@ -120,7 +120,7 @@ public class InterleavingTest extends AbstractTest
|
|||
byte[] content2 = new byte[2 * ((ISession)serverStream2.getSession()).updateSendWindow(0)];
|
||||
random.nextBytes(content2);
|
||||
|
||||
MetaData.Response response2 = new MetaData.Response(HttpVersion.HTTP_2, HttpStatus.OK_200, new HttpFields(), 0);
|
||||
MetaData.Response response2 = new MetaData.Response(HttpVersion.HTTP_2, HttpStatus.OK_200, new HttpFields());
|
||||
serverStream2.headers(new HeadersFrame(serverStream2.getId(), response2, null, false), new Callback()
|
||||
{
|
||||
@Override
|
||||
|
|
|
@ -119,7 +119,7 @@ public class HttpTransportOverHTTP2 implements HttpTransport
|
|||
{
|
||||
info.setContentLength(realContentLength);
|
||||
}
|
||||
else if (contentLength != realContentLength)
|
||||
else if (hasContent && contentLength != realContentLength)
|
||||
{
|
||||
callback.failed(new BadMessageException(HttpStatus.INTERNAL_SERVER_ERROR_500, String.format("Incorrect Content-Length %d!=%d", contentLength, realContentLength)));
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue