From 0dfe1da0af5d9a13b09f7b5ae4a1f3db4cfd539a Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 31 Dec 2024 13:50:58 +0100 Subject: [PATCH] feat(assist): use .cork() to avoid warnings for uws --- assist/utils/httpHandlers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assist/utils/httpHandlers.js b/assist/utils/httpHandlers.js index 67b5b06f7..c6514e2dc 100644 --- a/assist/utils/httpHandlers.js +++ b/assist/utils/httpHandlers.js @@ -27,7 +27,9 @@ const respond = function (req, res, data) { res.setHeader('Content-Type', 'application/json'); res.end(JSON.stringify(result)); } else { - res.writeStatus('200 OK').writeHeader('Content-Type', 'application/json').end(JSON.stringify(result)); + res.cork(() => { + res.writeStatus('200 OK').writeHeader('Content-Type', 'application/json').end(JSON.stringify(result)); + }); } const duration = performance.now() - req.startTs; IncreaseTotalRequests();