hyperium / hyper

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

fix(client): auto content-length failing on curl #3632

Closed dswij closed 2 months ago

dswij commented 2 months ago

This PR now adds content-length to header automatically only when content-type is present.

This is also the case according to https://github.com/seanmonstar/reqwest/issues/2240#issuecomment-2044260263

See https://github.com/hyperium/hyper/commit/172fdfaf0e0d9222917f271a83339238082e2657#commitcomment-141005865, https://github.com/curl/curl/issues/13380

seanmonstar commented 2 months ago

I'm just going to revert it entirely: https://github.com/hyperium/hyper/pull/3633

dswij commented 2 months ago

Fair enough. I'm agreeing with https://github.com/curl/curl/issues/13380#issuecomment-2058847553 on hyper's "intelligence"