actix-web
actix-web copied to clipboard
[awc] HTTP client ignores Content-Length if Body is stream.
Expected Behavior
HTTP client should respect Content-Length even body of request is stream.
Current Behavior
Content-Length header is removed by client itself.
Possible Solution
respect Content-Length header if present.
also an enhancement, if first item of body stream is known as None it is better set Content-Length to zero. not inserting chunked encoding header.
Steps to Reproduce (for bugs)
Send request with empty stream.
Context
Cloudfront will reject you.
Your Environment
- Rust Version (I.e, output of
rustc -V): rustc 1.53.0 (53cb7b09b 2021-06-17) - Actix Web Version: awc 3.0.0-beta.7
Yes, I have the same problem, currently I have to read the whole stream to prevent it.
Or there is a SizedStream