fix getting 403 when parsing some rss url by setting a user agent in the request
This commit is contained in:
@ -118,9 +118,16 @@ Sentry.GCPFunction.init({
|
||||
|
||||
const signToken = promisify(jwt.sign)
|
||||
const parser = new Parser({
|
||||
timeout: 60000, // 60 seconds
|
||||
maxRedirects: 10,
|
||||
customFields: {
|
||||
item: [['link', 'links', { keepArray: true }], 'published', 'updated'],
|
||||
},
|
||||
headers: {
|
||||
// some rss feeds require user agent
|
||||
'User-Agent':
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
|
||||
},
|
||||
})
|
||||
|
||||
// get link following the order of preference: via, alternate, self
|
||||
|
||||
Reference in New Issue
Block a user