From e4612911785b88b4825d2489debace474aec88f7 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Thu, 19 Feb 2026 12:35:01 +0100 Subject: [PATCH] fix: skip Fedify middleware for admin UI routes POST to /admin/migrate was going through Fedify's federation.fetch() which consumed the already-parsed request body stream, causing "response body object should not be distributed or locked" errors. Admin routes (/admin/*) are UI routes handled by authenticated Express handlers, not federation endpoints. --- index.js | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 37cb6b1..d0f2fb8 100644 --- a/index.js +++ b/index.js @@ -84,6 +84,9 @@ export default class ActivityPubEndpoint { router.use((req, res, next) => { if (!self._fedifyMiddleware) return next(); + // Skip Fedify for admin UI routes — they're handled by the + // authenticated `routes` getter, not the federation layer. + if (req.path.startsWith("/admin")) return next(); return self._fedifyMiddleware(req, res, next); }); diff --git a/package.json b/package.json index 887ed39..ff82906 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "1.0.1", + "version": "1.0.2", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit",