Skip to content

Node.js based forum software built for the modern web

fix: force outgoing page on direct access to `/ap` handler

Julian Lam9cee799937c3
diff --git a/src/controllers/activitypub/index.js b/src/controllers/activitypub/index.js
index 121c8536aa..c64ef9ef57 100644
--- a/src/controllers/activitypub/index.js
+++ b/src/controllers/activitypub/index.js
@@ -48,6 +48,11 @@ Controller.fetch = async (req, res, next) => {
}
}
+ // Force outgoing links page on direct access
+ if (!res.locals.isAPI) {
+ url = new URL(`outgoing?url=${encodeURIComponent(url.href)}`, nconf.get('url'));
+ }
+
helpers.redirect(res, url.href, false);
} catch (e) {
if (!url || !url.href) {