From 01a6e809d7117b21f8df3da810044e391d526463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=95=8F?= Date: Fri, 19 Apr 2024 14:28:16 +0800 Subject: [PATCH] Update callback.cjs Incorrect content-length in callback.js when body contains non-ascii characters --- bin/callback.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/callback.cjs b/bin/callback.cjs index 418f7c3..b41c9a5 100644 --- a/bin/callback.cjs +++ b/bin/callback.cjs @@ -44,7 +44,7 @@ const callbackRequest = (url, timeout, data) => { method: 'POST', headers: { 'Content-Type': 'application/json', - 'Content-Length': data.length + 'Content-Length': Buffer.byteLength(data) } } const req = http.request(options)