feat: fix activitypub toggler to be more complete; tests. #13054

This commit is contained in:
Julian Lam
2025-01-20 12:05:17 -05:00
parent 3e08eb3925
commit af4d07fba4
6 changed files with 64 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
const nconf = require('nconf');
const winston = require('winston');
const meta = require('../../meta');
const user = require('../../user');
const activitypub = require('../../activitypub');
const helpers = require('../helpers');
@@ -14,7 +15,7 @@ Controller.topics = require('./topics');
Controller.fetch = async (req, res, next) => {
// Given a `resource` query parameter, attempts to retrieve and parse it
if (!req.query.resource) {
if (!meta.config.activitypubEnabled || !req.query.resource) {
return next();
}

View File

@@ -99,7 +99,7 @@ apiController.loadConfig = async function (req) {
version: fontawesome_version,
},
activitypub: {
probe: meta.config.activitypubProbe,
probe: meta.config.activitypubEnabled && meta.config.activitypubProbe,
},
};