forked from Mirrors/doipjs
Fix missing user-agent headers
This commit is contained in:
parent
bfc64ce898
commit
1720c59093
4 changed files with 9 additions and 2 deletions
|
@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
- Added missing user-agent headers
|
||||
|
||||
## [0.18.0] - 2022-11-17
|
||||
### Changed
|
||||
|
|
|
@ -66,7 +66,8 @@ module.exports.fn = async (data, opts) => {
|
|||
const headers = {
|
||||
host,
|
||||
date: now.toUTCString(),
|
||||
accept: 'application/activity+json'
|
||||
accept: 'application/activity+json',
|
||||
'User-Agent': `doipjs/${require('../../package.json').version}`
|
||||
}
|
||||
|
||||
if (isConfigured && jsEnv.isNode) {
|
||||
|
|
|
@ -58,7 +58,10 @@ module.exports.fn = async (data, opts) => {
|
|||
const url = `https://${opts.claims.matrix.instance}/_matrix/client/r0/rooms/${data.roomId}/event/${data.eventId}?access_token=${opts.claims.matrix.accessToken}`
|
||||
axios.get(url,
|
||||
{
|
||||
headers: { Accept: 'application/json' }
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'User-Agent': `doipjs/${require('../../package.json').version}`
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
return res.data
|
||||
|
|
|
@ -59,6 +59,7 @@ module.exports.fn = async (data, opts) => {
|
|||
{
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'User-Agent': `doipjs/${require('../../package.json').version}`,
|
||||
Authorization: `Bearer ${opts.claims.twitter.bearerToken}`
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue