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

fix(ext/body): .bodyUsed for static body #16080

Merged
merged 4 commits into from
Sep 29, 2022

Conversation

marcosc90
Copy link
Contributor

Fixes an edge case for .bodyUsed for static bodies when .body getter is called after consuming the body.

const response = new Response("body");
await response.text();
console.log(response.bodyUsed); // true
response.body;
console.log(response.bodyUsed); // false

@@ -90,3 +90,14 @@ Deno.test(function customInspectFunction() {
);
assertStringIncludes(Deno.inspect(Response.prototype), "Response");
});

Deno.test(async function responseBodyUsed() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fails on main

ext/fetch/22_body.js Outdated Show resolved Hide resolved
Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@lucacasonato lucacasonato merged commit 927f4e2 into denoland:main Sep 29, 2022
@marcosc90 marcosc90 deleted the fix-bodyused branch September 29, 2022 15:39
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.

None yet

2 participants