mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: store encountered instances by last seen date
This commit is contained in:
@@ -68,6 +68,10 @@ middleware.validate = async function (req, res, next) {
|
|||||||
req.body.actor = actor;
|
req.body.actor = actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Domain check
|
||||||
|
const { hostname } = new URL(actor);
|
||||||
|
await db.sortedSetAdd('instances:lastSeen', Date.now(), hostname);
|
||||||
|
|
||||||
// Origin checking
|
// Origin checking
|
||||||
if (typeof object !== 'string' && object.hasOwnProperty('id')) {
|
if (typeof object !== 'string' && object.hasOwnProperty('id')) {
|
||||||
const actorHostnames = Array.isArray(actor) ? actor.map(a => new URL(a).hostname) : [new URL(actor).hostname];
|
const actorHostnames = Array.isArray(actor) ? actor.map(a => new URL(a).hostname) : [new URL(actor).hostname];
|
||||||
|
|||||||
Reference in New Issue
Block a user