hyperium / hyper

An HTTP library for Rust
https://hyper.rs
MIT License
14.42k stars 1.59k forks source link

fix(http1): reject final chunked if missing 0 #3698

Closed seanmonstar closed 2 months ago

seanmonstar commented 2 months ago

If a chunked body had valid chunks, but ended without a 0 in the final chunk (so, just \r\n\r\n), it would be parsed as a valid end. Now it will be rejected as the final chunk MUST be 0\r\n\r\n.

This was partially done before (https://github.com/hyperium/hyper/pull/3494), but only if there were no chunks before the final. This fixes both paths.