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.
This commit is contained in:
Ricardo
2026-02-19 12:35:01 +01:00
parent 599f15e8b4
commit e461291178
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -84,6 +84,9 @@ export default class ActivityPubEndpoint {
router.use((req, res, next) => { router.use((req, res, next) => {
if (!self._fedifyMiddleware) return 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); return self._fedifyMiddleware(req, res, next);
}); });
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@rmdes/indiekit-endpoint-activitypub", "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.", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
"keywords": [ "keywords": [
"indiekit", "indiekit",