diff --git a/src/worker.ts b/src/worker.ts index da9bccf..3048b5d 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -20,7 +20,7 @@ export default { } const webhookPayload = await request.json(); - const settings = Value.Decode(pluginSettingsSchema, Value.Default(pluginSettingsSchema, JSON.parse(webhookPayload.settings))); + const settings = Value.Decode(pluginSettingsSchema, Value.Default(pluginSettingsSchema, webhookPayload.settings)); if (!pluginSettingsValidator.test(settings)) { const errors: string[] = []; @@ -45,7 +45,6 @@ export default { }); } - webhookPayload.eventPayload = JSON.parse(webhookPayload.eventPayload); webhookPayload.settings = settings; await plugin(webhookPayload, env); return new Response(JSON.stringify("OK"), { status: 200, headers: { "content-type": "application/json" } });