Skip to content

Conversation

@mcollina
Copy link
Member

@mcollina mcollina commented Dec 3, 2024

This PR does two things:

  1. if a stream is provided as the body of the request, it does not accumulate it anymore but forward it respecting backpressure instead.
  2. fix an old incosistency with non-fake servers that had a response being sent even if the dispatched handler aborted

Checklist

Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
lib/request.js Outdated
}
{
const payload = this._lightMyRequest.payload
if (payload && payload._readableState) { // does not quack like a stream

Choose a reason for hiding this comment

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

I think you mean "quacks like a stream" here :)

Copy link
Member

Choose a reason for hiding this comment

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

I would just fix this comment.

Copy link

@ShogunPanda ShogunPanda left a comment

Choose a reason for hiding this comment

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

Small nits, but LGTM!

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@mcollina mcollina requested a review from a team December 18, 2024 17:36
@mcollina
Copy link
Member Author

@fastify/libraries I need another review

Signed-off-by: Matteo Collina <hello@matteocollina.com>
lib/request.js Outdated
}
{
const payload = this._lightMyRequest.payload
if (payload && payload._readableState) { // does not quack like a stream
Copy link
Member

Choose a reason for hiding this comment

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

I would just fix this comment.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@mcollina mcollina merged commit ef771a9 into master Dec 19, 2024
13 checks passed
@mcollina mcollina deleted the streaming-input branch December 19, 2024 08:24
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.

4 participants