mirror of
https://github.com/dariusk/rss-to-activitypub.git
synced 2024-12-22 21:53:32 +02:00
Protect against TypeError
Only attempt to call req.headers.accept.include() if req.headers.accept exists.
This commit is contained in:
parent
04801687d9
commit
5ad4516a70
1 changed files with 1 additions and 1 deletions
|
@ -15,7 +15,7 @@ router.get('/:name', function (req, res) {
|
|||
if (result === undefined) {
|
||||
return res.status(404).json(`No record found for ${name}.`);
|
||||
}
|
||||
else if (req.headers.accept.includes('application/activity+json') || req.headers.accept.includes('application/json') || req.headers.accept.includes('application/json+ld')) {
|
||||
else if (req.headers.accept && (req.headers.accept.includes('application/activity+json') || req.headers.accept.includes('application/json') || req.headers.accept.includes('application/json+ld'))) {
|
||||
res.json(JSON.parse(result.actor));
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue