mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: reject spiders on remote profile GETs
This commit is contained in:
@@ -7,6 +7,10 @@ const pagination = require('../../pagination');
|
|||||||
const controller = module.exports;
|
const controller = module.exports;
|
||||||
|
|
||||||
controller.get = async function (req, res, next) {
|
controller.get = async function (req, res, next) {
|
||||||
|
if (req.uid === -1) {
|
||||||
|
return helpers.notAllowed(req, res);
|
||||||
|
}
|
||||||
|
|
||||||
const { userslug: uid } = req.params;
|
const { userslug: uid } = req.params;
|
||||||
const actor = await getActor(req.uid, uid);
|
const actor = await getActor(req.uid, uid);
|
||||||
if (!actor) {
|
if (!actor) {
|
||||||
@@ -18,6 +22,10 @@ controller.get = async function (req, res, next) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
controller.getFollow = async function (tpl, name, req, res) {
|
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 actor = await getActor(req.uid, req.params.userslug);
|
||||||
|
|
||||||
const { userslug } = req.params;
|
const { userslug } = req.params;
|
||||||
|
|||||||
Reference in New Issue
Block a user