mirror of
https://github.com/dariusk/express-activitypub.git
synced 2025-05-04 01:04:44 +00:00
Update user.js
Mastodon rejects messages that are "application/json" mime type, which is the default for a .json() call in Express. Have to add the "application/activity+json" Content-Type instead.
This commit is contained in:
parent
612e316345
commit
0605621b2f
1 changed files with 3 additions and 0 deletions
|
@ -23,6 +23,7 @@ router.get('/:name', function (req, res) {
|
||||||
if (tempActor.followers === undefined) {
|
if (tempActor.followers === undefined) {
|
||||||
tempActor.followers = `https://${domain}/u/${username}/followers`;
|
tempActor.followers = `https://${domain}/u/${username}/followers`;
|
||||||
}
|
}
|
||||||
|
res.set('Content-Type', 'application/activity+json');
|
||||||
res.json(tempActor);
|
res.json(tempActor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +54,7 @@ router.get('/:name/followers', function (req, res) {
|
||||||
},
|
},
|
||||||
"@context":["https://www.w3.org/ns/activitystreams"]
|
"@context":["https://www.w3.org/ns/activitystreams"]
|
||||||
};
|
};
|
||||||
|
res.set('Content-Type', 'application/activity+json');
|
||||||
res.json(followersCollection);
|
res.json(followersCollection);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -78,6 +80,7 @@ router.get('/:name/outbox', function (req, res) {
|
||||||
},
|
},
|
||||||
"@context":["https://www.w3.org/ns/activitystreams"]
|
"@context":["https://www.w3.org/ns/activitystreams"]
|
||||||
};
|
};
|
||||||
|
res.set('Content-Type', 'application/activity+json');
|
||||||
res.json(outboxCollection);
|
res.json(outboxCollection);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue