From b4776c6ba8fe91eb74ef186cd0c8cef61e0bf8f9 Mon Sep 17 00:00:00 2001 From: catvod <88956744+catvod@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:50:19 +0800 Subject: [PATCH] Update index.js --- open/wrapper/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/open/wrapper/index.js b/open/wrapper/index.js index 3c6f57e..d46e3b1 100644 --- a/open/wrapper/index.js +++ b/open/wrapper/index.js @@ -95,8 +95,9 @@ async function request(url, opt) { data.on('end', async () => { if (stream['onDone']) await stream['onDone'](); }); + } else { + if (stream['onDone']) await stream['onDone'](); } - if (stream['onDone']) await stream['onDone'](); return 'stream...'; } return { code: resp.status, headers: resHeader, content: data };