Skip to content

🎥 Make videos programmatically with React

fix(serverless): count webhook Content-Length in bytes

DeryFerd31ff89719d14
diff --git a/packages/serverless/src/invoke-webhook.ts b/packages/serverless/src/invoke-webhook.ts
index a0b6e4ff5d..5faa742837 100644
--- a/packages/serverless/src/invoke-webhook.ts
+++ b/packages/serverless/src/invoke-webhook.ts
@@ -26,7 +26,7 @@ async function invokeWebhookRaw({
method: 'POST',
headers: {
'Content-Type': 'application/json',
- 'Content-Length': String(jsonPayload.length),
+ 'Content-Length': String(Buffer.byteLength(jsonPayload)),
'X-Remotion-Mode': 'production',
'X-Remotion-Signature': calculateSignature(jsonPayload, secret),
'X-Remotion-Status': payload.type,