diff options
author | Tobias Nießen <tniessen@tnie.de> | 2022-05-06 00:57:31 +0300 |
---|---|---|
committer | RafaelGSS <rafael.nunu@hotmail.com> | 2022-05-10 15:13:18 +0300 |
commit | c64b8d32829a67ed6984d302bce2794d859e72e4 (patch) | |
tree | 9ece16a6b48321dbb4f01fbe6fa9cb2634cad64d /lib | |
parent | 41d2f6e8c5caf224d58f9870f6dc7e9dc7171d7a (diff) |
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 <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/bootstrap/pre_execution.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index de42598ea7c..f285821ac4c 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. |