Add User-Agent to HTTP requests

This commit is contained in:
Yarmo Mackenbach 2020-11-17 02:13:06 +01:00
parent 4f19bd9a38
commit 8b1b741124

View file

@ -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':