Add a body wrapper that validates the returned length against content length
rcoh opened this issue · comments
Although Hyper attempts to protect against this case, in general it is possible for our HTTP client to return bodies that are shorter (or longer!) than we expect.
In this case, we should return an error to the customer (rather than happily returning obviously wrong data).
This should be handled by wrapping the body in a body wrapper that is constructed based on the content length returned from the server (similar to how checksum wrapping works today).
Unlike checksums, this would always be installed.
Implemented in #3491
Looks like the fix was disabled due to #3523