mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
adjust test webhook
This commit is contained in:
1 parent
b394854e9d
commit
6d2b3bb654
1 file changed
+8
-6
@@ -30,14 +30,16 @@ class SendTestWebhookRequestJob
|
|||||||
raise LocalhostError, "Can't send to localhost." if uri.host.in?(SendWebhookRequest::LOCALHOSTS)
|
raise LocalhostError, "Can't send to localhost." if uri.host.in?(SendWebhookRequest::LOCALHOSTS)
|
||||||
end
|
end
|
||||||
|
|
||||||
Faraday.post(webhook_url.url,
|
body_json = {
|
||||||
{
|
event_type: 'form.completed',
|
||||||
event_type: 'form.completed',
|
timestamp: Time.current.iso8601,
|
||||||
timestamp: Time.current.iso8601,
|
data: Submitters::SerializeForWebhook.call(submitter)
|
||||||
data: Submitters::SerializeForWebhook.call(submitter)
|
}.to_json
|
||||||
}.to_json,
|
|
||||||
|
Faraday.post(webhook_url.url, body_json,
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'User-Agent' => USER_AGENT,
|
'User-Agent' => USER_AGENT,
|
||||||
|
'X-Docuseal-Signature' => WebhookUrls::Signatures.sign(webhook_url.hmac_secret, body: body_json),
|
||||||
**webhook_url.secret.to_h)
|
**webhook_url.secret.to_h)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user