Open
Description
Discovered during #62870, similar to #62258:
In HTTP 2.0, a response payload body size that mismatches Content-Length
is protocol violation, and should result in RST_STREAM according to the RFC:
https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.6
https://datatracker.ietf.org/doc/html/rfc7540#section-5.4.2
WinHttpHandler doesn't respect this either. Current behavior:
SocketsHttpHandler
:- HTTP 1.1: reads
Content-Length
bytes, no error - HTTP 2.0: reads the entire content, no error
- HTTP 1.1: reads
WinHttpHandler
- HTTP2 before WinHttp: always read HTTP/2 streams to the end #62870: reads
Content-Length
bytes, no error - HTTP2 after WinHttp: always read HTTP/2 streams to the end #62870: reads all the bytes
- HTTP11: reads
Content-Length
bytes, no error
- HTTP2 before WinHttp: always read HTTP/2 streams to the end #62870: reads