Update callback.cjs

Incorrect content-length in callback.js when body contains non-ascii characters
This commit is contained in:
陈敏 2024-04-19 14:28:16 +08:00 committed by GitHub
parent 7945a5ba12
commit 01a6e809d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)