From 8b1b741124ea591a0c47a6d1d0217f9057606571 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 17 Nov 2020 02:13:06 +0100 Subject: [PATCH] Add User-Agent to HTTP requests --- src/serviceproviders.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/serviceproviders.js b/src/serviceproviders.js index fdcc3ae..b21805c 100644 --- a/src/serviceproviders.js +++ b/src/serviceproviders.js @@ -71,7 +71,10 @@ const directRequestHandler = async (spData, opts) => { switch (spData.proof.format) { case 'json': - res = await req(url, null, { Accept: 'application/json' }) + res = await req(url, null, { + Accept: 'application/json', + 'User-Agent': `doipjs/${require('../package.json').version}`, + }) return await res.json() break case 'text':