Skip to content

Node.js based forum software built for the modern web

fix: reject spiders on remote profile GETs

Julian Lama355c05d83d8
diff --git a/src/controllers/activitypub/profiles.js b/src/controllers/activitypub/profiles.js
index fe00c5a412..65202b449b 100644
--- a/src/controllers/activitypub/profiles.js
+++ b/src/controllers/activitypub/profiles.js
@@ -7,6 +7,10 @@ const pagination = require('../../pagination');
const controller = module.exports;
controller.get = async function (req, res, next) {
+ if (req.uid === -1) {
+ return helpers.notAllowed(req, res);
+ }
+
const { userslug: uid } = req.params;
const actor = await getActor(req.uid, uid);
if (!actor) {
@@ -18,6 +22,10 @@ controller.get = async function (req, res, next) {
};
controller.getFollow = async function (tpl, name, req, res) {
+ if (req.uid === -1) {
+ return helpers.notAllowed(req, res);
+ }
+
const actor = await getActor(req.uid, req.params.userslug);
const { userslug } = req.params;