Repository navigation
quiche: enforce content-length header consistency - #18459
Conversation
Signed-off-by: Dan Zhang <[email protected]>
|
/assign @alyssawilk |
Signed-off-by: Dan Zhang <[email protected]>
alyssawilk
left a comment
There was a problem hiding this comment.
Thanks for picking this one up! just 2 nits and you're good to go
| if (received_content_bytes_ > content_length_.value() || | ||
| (end_stream && received_content_bytes_ != content_length_.value())) { | ||
| // Reset instead of closing the connection to align with nghttp2. | ||
| onStreamError(false); |
There was a problem hiding this comment.
can we make sure the stream would have informative error details here?
There was a problem hiding this comment.
added inconsistent_content_length response code detail
| } | ||
| } | ||
|
|
||
| TEST_P(DownstreamProtocolIntegrationTest, ContentLengthLargerThanPayload) { |
There was a problem hiding this comment.
What do you think of one additional test in multiplexed integration test where we have an incorrect body length and trailers, just to test the accounting you added there?
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
|
one more thing sorry, can you add the TODO to clean up once we enforce upstream? |
Signed-off-by: Dan Zhang <[email protected]>
83c154b to
a097a9d
Compare
done |
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
alyssawilk
left a comment
There was a problem hiding this comment.
cc @wrowe could you do a quick pass and let me know if there's anything other than 304/HEAD that content length validation doesn't apply to?
|
/assign @wrowe |
|
Guess not :-/ |
Signed-off-by: Dan Zhang [email protected]
Commit Message: If request/response has content-length header, its value must be the equal to the actually body length. Otherise reset the stream as nghttp2 does.
Risk Level: low
Testing: added integration tests