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" },