From 1202a7298e550be7ed51fa4f4a5302fab408ad47 Mon Sep 17 00:00:00 2001 From: Rodrigo Polo Date: Mon, 24 Sep 2018 15:19:11 -0300 Subject: [PATCH] Add signature secret on request header --- app/workers/work_package_webhook_job.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/workers/work_package_webhook_job.rb b/app/workers/work_package_webhook_job.rb index cf4baa9fe4..724dfe5ad3 100644 --- a/app/workers/work_package_webhook_job.rb +++ b/app/workers/work_package_webhook_job.rb @@ -42,13 +42,14 @@ class WorkPackageWebhookJob < WebhookJob def perform body = request_body + headers = request_headers exception = nil if signature = request_signature(body) - request_headers['HTTP_X_OP_SIGNATURE'] = signature + headers['X-OP-Signature'] = signature end - response = RestClient.post webhook.url, request_body, request_headers + response = RestClient.post webhook.url, request_body, headers rescue RestClient::Exception => e response = e.response @@ -62,7 +63,7 @@ class WorkPackageWebhookJob < WebhookJob webhook: webhook, event_name: event_name, url: webhook.url, - request_headers: request_headers, + request_headers: headers, request_body: body, response_code: response.try(:code).to_i, response_headers: response.try(:headers),