From 6f63db8ef877595b5de84e8ac19ebf58b10cd777 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Fri, 9 Oct 2020 13:43:18 +0300 Subject: [PATCH] fixed user-agent for webhook requests --- webhooks.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webhooks.js b/webhooks.js index dd89965d..0e3d4b2c 100644 --- a/webhooks.js +++ b/webhooks.js @@ -8,11 +8,16 @@ const Queue = require('bull'); const db = require('./lib/db'); const { ObjectID } = require('mongodb'); const axios = require('axios'); +const packageData = require('./package.json'); let loggelf; async function postWebhook(webhook, data) { - let res = await axios.post(webhook.url, data); + let res = await axios.post(webhook.url, data, { + headers: { + 'User-Agent': `wildduck/${packageData.version}` + } + }); if (!res) { throw new Error(`Failed to POST request to ${webhook.url}`); }