mirror of
https://github.com/svemagie/indiekit-endpoint-activitypub.git
synced 2026-04-02 15:44:58 +02:00
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:
3
index.js
3
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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user