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:
@@ -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
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user