mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 14:39:28 -07:00
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
### Fixed
|
||||||
|
- Added missing user-agent headers
|
||||||
|
|
||||||
## [0.18.0] - 2022-11-17
|
## [0.18.0] - 2022-11-17
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -66,7 +66,8 @@ module.exports.fn = async (data, opts) => {
|
||||||
const headers = {
|
const headers = {
|
||||||
host,
|
host,
|
||||||
date: now.toUTCString(),
|
date: now.toUTCString(),
|
||||||
accept: 'application/activity+json'
|
accept: 'application/activity+json',
|
||||||
|
'User-Agent': `doipjs/${require('../../package.json').version}`
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isConfigured && jsEnv.isNode) {
|
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}`
|
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,
|
axios.get(url,
|
||||||
{
|
{
|
||||||
headers: { Accept: 'application/json' }
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
'User-Agent': `doipjs/${require('../../package.json').version}`
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
return res.data
|
return res.data
|
||||||
|
|
|
@ -59,6 +59,7 @@ module.exports.fn = async (data, opts) => {
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
|
'User-Agent': `doipjs/${require('../../package.json').version}`,
|
||||||
Authorization: `Bearer ${opts.claims.twitter.bearerToken}`
|
Authorization: `Bearer ${opts.claims.twitter.bearerToken}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue