Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[awc] HTTP client ignores Content-Length if Body is stream. #2306

Open
ArtBlnd opened this issue Jul 8, 2021 · 1 comment · May be fixed by #3015
Open

[awc] HTTP client ignores Content-Length if Body is stream. #2306

ArtBlnd opened this issue Jul 8, 2021 · 1 comment · May be fixed by #3015
Labels
A-awc project: awc C-bug Category: bug

Comments

@ArtBlnd
Copy link

ArtBlnd commented Jul 8, 2021

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
@robjtede robjtede added C-bug Category: bug A-awc project: awc labels Jul 12, 2021
@henry42
Copy link

henry42 commented Sep 21, 2022

Yes, I have the same problem, currently I have to read the whole stream to prevent it.
Or there is a SizedStream

@dynos01 dynos01 linked a pull request Apr 14, 2023 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-awc project: awc C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants