-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
Use async iterators to get response body #1256
Conversation
Why not just do this directly in |
Sure, I just want to test things before we make an actual release :) |
I'll merge this for now. I think this may fix #1187. |
@szmarczak We upgraded I can patch it locally by replacing the following: for await (const chunk of stream) {
chunks.push(chunk);
length += Buffer.byteLength(chunk);
} By this: const {PassThrough} = require(`stream`);
const copy = new PassThrough();
stream.pipe(copy);
for await (const chunk of copy) {
chunks.push(chunk);
length += Buffer.byteLength(chunk);
} I suspect this is because the various Node stream interfaces aren't meant to be used together, and weird effects are possible should that happen. I don't know if that's the case for sure here 🙁 |
@arcanis That seems weird. What Node.js version are you using? It'd be best to open a new issue so we don't lose the track here. This looks like a Node.js bug. |
Just to utilize newest Node.js features :)
Checklist