Skip to content
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

Response.bodyUsed should be false when there is no body #1686

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tkrotoff
Copy link
Contributor

@tkrotoff tkrotoff commented Dec 2, 2022

Fix #1684

const res = new Response(toCheck);
expect(res.bodyUsed).to.equal(false);

/* eslint-disable-next-line no-await-in-loop */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't think this lint rule matters in context of unit test

@@ -209,6 +207,8 @@ async function consumeBody(data) {
return Buffer.alloc(0);
}

data[INTERNALS].disturbed = true;

/* c8 ignore next 3 */
if (!(body instanceof Stream)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't know if disturbed = true should be done after this line

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.

Response.bodyUsed should be false when there is no body
1 participant