From c64b8d32829a67ed6984d302bce2794d859e72e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Thu, 5 May 2022 23:57:31 +0200 Subject: [PATCH] lib,test: enable wasm/webapi/empty-body WPT Refs: https://github.com/nodejs/node/pull/42701 Refs: https://github.com/nodejs/undici/pull/1346 Refs: https://github.com/nodejs/node/pull/42939 PR-URL: https://github.com/nodejs/node/pull/42960 Reviewed-By: Antoine du Hamel Reviewed-By: Joyee Cheung --- lib/internal/bootstrap/pre_execution.js | 7 +++++-- test/wpt/status/wasm/webapi.json | 3 --- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index de42598ea7c45a..f285821ac4c0db 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -250,8 +250,11 @@ function setupFetch() { } // Pass all data from the response body to the WebAssembly compiler. - for await (const chunk of response.body) { - streamState.push(chunk); + const { body } = response; + if (body != null) { + for await (const chunk of body) { + streamState.push(chunk); + } } })().then(() => { // No error occurred. Tell the implementation that the stream has ended. diff --git a/test/wpt/status/wasm/webapi.json b/test/wpt/status/wasm/webapi.json index e631f5c0a95310..e89b08d8b7576c 100644 --- a/test/wpt/status/wasm/webapi.json +++ b/test/wpt/status/wasm/webapi.json @@ -12,9 +12,6 @@ "contenttype.any.js": { "skip": "WPTRunner does not support fetch()" }, - "empty-body.any.js": { - "skip": "Bug in undici, see https://github.com/nodejs/undici/issues/1345" - }, "idlharness.any.js": { "skip": "not configured" },