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] Fix response body when no content-length header #3038

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

armandmgt
Copy link

@armandmgt armandmgt commented May 20, 2023

PR Type

Bug Fix for awc

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

As noted in #2287 response body should be read until connection is closed when neither Transfer-Encoding nor Content-Length are specified in HTTP/1.1 (item 7 in https://www.rfc-editor.org/rfc/rfc7230#section-3.3.3).
In order not to break any current tests I added a check for the presence of the Connection: close header (which is not required by the spec).
For reference this is how go's standard library is doing it: https://github.com/golang/go/blob/aeb0644bd33e67f24e2411a651ac9ff72ddc96b4/src/net/http/transfer.go#L548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants