hyperium / hyper

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

fix(client): send content-length even with no body #3630

Closed seanmonstar closed 2 months ago

seanmonstar commented 2 months ago

Most request methods define a payload. If hyper detects that no body has been included, it will now include a content-length: 0 header automatically.

It will not do this for methods that don't have defined payloads (GET, HEAD, and CONNECT).