Skip to content

fix: send a request body that was set from a stream - #163

Merged
Vincent Biret (baywet) merged 1 commit into
microsoft:mainfrom
andreaTP:fix/stream-request-body
Sep 22, 2026
Merged

Vincent Biret (baywet) merged 1 commit into
microsoft:mainfrom
andreaTP:fix/stream-request-body

Conversation

@andreaTP

Copy link
Copy Markdown
Contributor

set_stream_content takes whatever the caller has, so the body can be an IO, and the adapter called empty? on it, which only a String answers to.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Resolve the conflicting framing headers and negative Content-Length handling before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Clear stale Content-Length and Transfer-Encoding headers for empty seekable streams.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Remaining stream length must not produce a negative Content-Length.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
Resolved since last review (1)

set_stream_content takes whatever the caller has, so the body can be an IO, and the adapter called empty? on it, which only a String answers to. The stream is passed to Faraday with its length rather than read into memory, and the request now owns its framing headers instead of leaving whatever the caller sent.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved review issues remain, and coverage includes the supported body-handling cases.

Review effort: Lite
Findings: None

Resolved since last review (2)

@baywet
Vincent Biret (baywet) merged commit 74157a4 into microsoft:main Sep 22, 2026
72 checks passed
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.

3 participants