Skip to content

fix Transfer-Encoding behavior in input for SimpleRequestsClient#39

Merged
bentsku merged 1 commit into
mainfrom
fix-simple-client
Jun 11, 2026
Merged

fix Transfer-Encoding behavior in input for SimpleRequestsClient#39
bentsku merged 1 commit into
mainfrom
fix-simple-client

Conversation

@bentsku

@bentsku bentsku commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Motivation

This was reported in https://github.com/orgs/localstack/discussions/35
We were forwarding the Transfer-Encoding header back to the server, even though it is a hop-by-hop server. We have done a lot of work already to remove it from responses, but we did not do it in the SimpleRequestsClient

It was however done in the Proxy a while back.

See hop-by-hop headers: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers

Hop-by-hop headers
These headers are meaningful only for a single transport-level connection, and must not be retransmitted by proxies or cached. Note that only hop-by-hop headers may be set using the Connection header.

Changes

  • add a one line to remove any Transfer-Encoding header which shouldn't be forwarded
  • add tests for it

@bentsku bentsku self-assigned this Jun 11, 2026
@bentsku bentsku requested a review from thrau as a code owner June 11, 2026 11:28
@bentsku bentsku requested a review from alexrashed June 11, 2026 12:55

@alexrashed alexrashed left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great change, great tests, great PR description outlining the changes and referring the spec! 🤩 :shipit:

@bentsku bentsku merged commit 06655f7 into main Jun 11, 2026
6 checks passed
@bentsku bentsku deleted the fix-simple-client branch June 11, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants