From 6d2b3bb654e06e15dad9c3092cffd6363a87f61d Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Tue, 20 Oct 2026 20:15:37 +0300 Subject: [PATCH] adjust test webhook --- app/jobs/send_test_webhook_request_job.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/jobs/send_test_webhook_request_job.rb b/app/jobs/send_test_webhook_request_job.rb index 0116cdafb..6b14769d6 100644 --- a/app/jobs/send_test_webhook_request_job.rb +++ b/app/jobs/send_test_webhook_request_job.rb @@ -30,14 +30,16 @@ class SendTestWebhookRequestJob raise LocalhostError, "Can't send to localhost." if uri.host.in?(SendWebhookRequest::LOCALHOSTS) end - Faraday.post(webhook_url.url, - { - event_type: 'form.completed', - timestamp: Time.current.iso8601, - data: Submitters::SerializeForWebhook.call(submitter) - }.to_json, + body_json = { + event_type: 'form.completed', + timestamp: Time.current.iso8601, + data: Submitters::SerializeForWebhook.call(submitter) + }.to_json + + Faraday.post(webhook_url.url, body_json, 'Content-Type' => 'application/json', 'User-Agent' => USER_AGENT, + 'X-Docuseal-Signature' => WebhookUrls::Signatures.sign(webhook_url.hmac_secret, body: body_json), **webhook_url.secret.to_h) end end