hyperium / hyper

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

Revert "fix(client): send content-length even with no body" #3633

Closed seanmonstar closed 5 months ago

seanmonstar commented 5 months ago

This reverts commit 172fdfaf0e0d9222917f271a83339238082e2657.

The curl test suite noticed this change, and it was unexpected. https://github.com/curl/curl/issues/13380

On further review, RFC 9112 Section 6.3 states:

If this is a request message and none of the above are true, then the message body length is zero (no message body is present).

So, hyper does not need to do this. Any server that fails to understand there is no body is in direct violation of the spec.