diff --git a/core/server/services/webhooks/trigger.js b/core/server/services/webhooks/trigger.js index d4ecb86559..73826c651a 100644 --- a/core/server/services/webhooks/trigger.js +++ b/core/server/services/webhooks/trigger.js @@ -1,5 +1,6 @@ const debug = require('@tryghost/debug')('services:webhooks:trigger'); const logging = require('@tryghost/logging'); +const ghostVersion = require('@tryghost/version'); class WebhookTrigger { /** @@ -88,7 +89,8 @@ class WebhookTrigger { body: reqPayload, headers: { 'Content-Length': Buffer.byteLength(reqPayload), - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', + 'Content-Version': `v${ghostVersion.safe}` }, timeout: 2 * 1000, retry: 5 diff --git a/test/unit/server/services/webhooks/trigger.test.js b/test/unit/server/services/webhooks/trigger.test.js index 0d4914a27d..094a9ad1be 100644 --- a/test/unit/server/services/webhooks/trigger.test.js +++ b/test/unit/server/services/webhooks/trigger.test.js @@ -76,6 +76,7 @@ describe('Webhook Service', function () { assert.deepEqual(requestStub.args[0][1].body, '{"data":[1]}'); assert.equal(requestStub.args[0][1].headers['Content-Length'], 12); assert.equal(requestStub.args[0][1].headers['Content-Type'], 'application/json'); + assert.match(requestStub.args[0][1].headers['Content-Version'], /v\d+\.\d+/); }); }); });