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

View File

@@ -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);
});