netty5/codec-http2/src/test/java/io/netty/handler/codec/http2
Cory Benfield 1b0a545921 Do not send Content-Length: 0 on 101 responses.
Motivation:

During code read of the Netty codebase I noticed that the Netty
HttpServerUpgradeHandler unconditionally sets a Content-Length: 0
header on 101 Switching Protocols responses. This explicitly
contravenes RFC 7230 Section 3.3.2 (Content-Length), which notes
that:

    A server MUST NOT send a Content-Length header field in any
    response with a status code of 1xx (Informational) or 204
    (No Content).

While it is unlikely that any client will ever be confused by
this behaviour, there is no reason to contravene this part of the
specification.

Modifications:

Removed the line of code setting the header field and changed the
only test that expected it to be there.

Result:

When performing the server portion of HTTP upgrade, the 101
Switching Protocols response will no longer contain a
Content-Length: 0 header field.
2017-10-21 14:36:19 +02:00
..
AbstractWeightedFairQueueByteDistributorDependencyTest.java Only use Mockito for mocking. 2017-02-07 08:47:22 +01:00
CleartextHttp2ServerUpgradeHandlerTest.java Do not send Content-Length: 0 on 101 responses. 2017-10-21 14:36:19 +02:00
DataCompressionHttp2Test.java fix the typos 2017-04-20 04:56:09 +02:00
DefaultHttp2ConnectionDecoderTest.java HTTP/2 enforce HTTP message flow 2017-07-19 13:37:23 -07:00
DefaultHttp2ConnectionEncoderTest.java HTTP/2 enforce HTTP message flow 2017-07-19 13:37:23 -07:00
DefaultHttp2ConnectionTest.java Remove deprecated usage of Mockito methods 2017-03-09 20:59:54 +01:00
DefaultHttp2FrameReaderTest.java HTTP/2 remove unnecessary buffer operations 2017-03-31 15:23:39 -07:00
DefaultHttp2FrameWriterTest.java Add unit test for DefaultHttp2FrameWriter 2017-02-21 09:57:16 +01:00
DefaultHttp2HeadersDecoderTest.java HTTP/2 move internal HPACK classes to the http2 package 2017-03-02 07:42:41 -08:00
DefaultHttp2HeadersEncoderTest.java HTTP/2 Max Header List Size Bug 2017-01-19 10:42:43 -08:00
DefaultHttp2HeadersTest.java fix the typos 2017-04-20 04:56:09 +02:00
DefaultHttp2LocalFlowControllerTest.java Remove deprecated usage of Mockito methods 2017-03-09 20:59:54 +01:00
DefaultHttp2RemoteFlowControllerTest.java HTTP/2 StreamByteDistributor improve parameter validation 2017-04-24 17:17:18 -07:00
HashCollisionTest.java Remove unsafe char[] access in PlatformDependent 2016-06-30 08:58:28 -07:00
HpackDecoderTest.java Move methods for decode hex dump into StringUtil 2017-06-23 18:52:42 +02:00
HpackEncoderTest.java HTTP/2 move internal HPACK classes to the http2 package 2017-03-02 07:42:41 -08:00
HpackHuffmanTest.java HTTP/2 move internal HPACK classes to the http2 package 2017-03-02 07:42:41 -08:00
HpackTest.java HTTP/2 move internal HPACK classes to the http2 package 2017-03-02 07:42:41 -08:00
HpackTestCase.java Move methods for decode hex dump into StringUtil 2017-06-23 18:52:42 +02:00
Http2ClientUpgradeCodecTest.java Match Http2ClientUpgradeCodec to the new upgrade policy 2017-09-20 12:42:43 -07:00
Http2ConnectionHandlerTest.java Fix NPE when using Http2ServerUpgradeCodec with Http2FrameCodec and Http2MultiplexCodec 2017-09-14 08:23:53 -07:00
Http2ConnectionRoundtripTest.java DefaultHttp2ConnectionEncoder#writeHeaders shouldn't send GO_AWAY if stream is closed 2017-06-28 12:06:00 -04:00
Http2FrameCodecTest.java Ensure the tests complete on java7 and java9 as well. 2017-09-04 20:20:04 +02:00
Http2FrameRoundtripTest.java Remove deprecated usage of Mockito methods 2017-03-09 20:59:54 +01:00
Http2HeaderBlockIOTest.java HTTP/2 Max Header List Size Bug 2017-01-19 10:42:43 -08:00
Http2MultiplexCodecBuilderTest.java Correctly update writability state of Http2StreamChannel created by Http2MultiplexCodec. 2017-09-14 08:25:31 -07:00
Http2MultiplexCodecTest.java Correctly update writability state of Http2StreamChannel created by Http2MultiplexCodec. 2017-09-14 08:25:31 -07:00
Http2ServerUpgradeCodecTest.java Fix NPE when using Http2ServerUpgradeCodec with Http2FrameCodec and Http2MultiplexCodec 2017-09-14 08:23:53 -07:00
Http2SettingsTest.java HTTP/2 Ensure default settings are correctly enforced and interfaces clarified 2016-10-07 13:00:45 -07:00
Http2StreamFrameToHttpObjectCodecTest.java Adapt Http2ServerDowngrader to work with clients 2017-09-22 11:04:43 -07:00
Http2TestUtil.java HTTP/2 move internal HPACK classes to the http2 package 2017-03-02 07:42:41 -08:00
HttpConversionUtilTest.java Use the index-based AsciiString constructor instead of substring() 2017-08-18 09:48:05 +02:00
HttpToHttp2ConnectionHandlerTest.java HTTP/2 Allow more time for EventLoopGroup to shutdown in test that use LocalChannel 2017-04-06 17:56:21 -07:00
InboundHttp2ToHttpAdapterTest.java Fix NPE in InboundHttp2ToHttpAdapter 2017-09-17 09:07:11 -07:00
LastInboundHandler.java HTTP/2 Child Channel and FrameCodec Feature Parity. 2017-08-11 12:41:28 +02:00
ReadOnlyHttp2HeadersTest.java DefaultHeaders value iterator 2017-09-16 16:46:19 -07:00
StreamBufferingEncoderTest.java Remove deprecated usage of Mockito methods 2017-03-09 20:59:54 +01:00
TestChannelInitializer.java h2childchan: Ability to open outbound/local streams. Fixes #4913 2016-10-06 16:12:19 -07:00
TestHeaderListener.java HTTP/2 move internal HPACK classes to the http2 package 2017-03-02 07:42:41 -08:00
UniformStreamByteDistributorFlowControllerTest.java HTTP/2 DefaultHttp2RemoteFlowController Stream writability notification broken 2015-12-21 10:01:33 +01:00
UniformStreamByteDistributorTest.java Remove deprecated usage of Mockito methods 2017-03-09 20:59:54 +01:00
WeightedFairQueueByteDistributorDependencyTreeTest.java HTTP/2 StreamByteDistributor improve parameter validation 2017-04-24 17:17:18 -07:00
WeightedFairQueueByteDistributorTest.java HTTP/2 StreamByteDistributor improve parameter validation 2017-04-24 17:17:18 -07:00
WeightedFairQueueRemoteFlowControllerTest.java HTTP/2 DefaultHttp2RemoteFlowController Stream writability notification broken 2015-12-21 10:01:33 +01:00