-
Notifications
You must be signed in to change notification settings - Fork 299
Conversation
License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
src/lib/error-handler.js
Outdated
// | ||
// If the body in the clone is not consumed or destroyed the highwater mark | ||
// will be reached (for large payloads) and stop the real body from flowing. | ||
if (isNode) response.body.destroy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This...sucks...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ky
has some, uh, interesting caveats.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
for await (const chunk of toIterable(res.body)) { | ||
yield Buffer.from(chunk) | ||
} | ||
})() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this a IIEF ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a generator function that needs to be called to obtain the generator. I can split this out into a definition and a return of the called function if you think it’ll be easier to understand?
No description provided.