diff --git a/src/node_modules/@internal/micro-frame-component/node.marko b/src/node_modules/@internal/micro-frame-component/node.marko index c94a0eb..75c215c 100644 --- a/src/node_modules/@internal/micro-frame-component/node.marko +++ b/src/node_modules/@internal/micro-frame-component/node.marko @@ -1,6 +1,7 @@ import path from "path"; import https from "https"; import fetch from "make-fetch-happen"; +import consumeResponseBody from "../../../util/consume-body"; static const { ca } = https.globalAgent.options; static const cachePath = path.resolve("node_modules/.cache/fetch"); static const strictSSL = process.env.NODE_TLS_REJECT_UNAUTHORIZED !== "0"; @@ -81,11 +82,7 @@ static async function fetchBody(input, out, buffer) { if (buffer) return res.text(); - if (!res.body || !res.body[Symbol.asyncIterator]) { - throw new Error("Response body must be a stream."); - } - - return res.body[Symbol.asyncIterator](); + return consumeResponseBody(res); }