DEV: Add modifier for webhook event header generation (#27054)

This commit is contained in:
Mark VanLandingham
2024-05-17 09:33:39 -05:00
committed by GitHub
parent a388f41dd4
commit 9264479c27
2 changed files with 40 additions and 0 deletions

View File

@@ -45,7 +45,15 @@ module Jobs
web_hook_body = build_webhook_body
web_hook_event = create_webhook_event(web_hook_body)
uri = URI(@web_hook.payload_url.strip)
web_hook_headers = build_webhook_headers(uri, web_hook_body, web_hook_event)
web_hook_headers =
DiscoursePluginRegistry.apply_modifier(
:web_hook_event_headers,
web_hook_headers,
web_hook_body,
web_hook_event,
)
emitter = WebHookEmitter.new(@web_hook, web_hook_event)
web_hook_response = emitter.emit!(headers: web_hook_headers, body: web_hook_body)