@rmdes/indiekit-endpoint-activitypub 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +7 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -84,6 +84,9 @@ export default class ActivityPubEndpoint {
84
84
 
85
85
  router.use((req, res, next) => {
86
86
  if (!self._fedifyMiddleware) return next();
87
+ // Skip Fedify for admin UI routes — they're handled by the
88
+ // authenticated `routes` getter, not the federation layer.
89
+ if (req.path.startsWith("/admin")) return next();
87
90
  return self._fedifyMiddleware(req, res, next);
88
91
  });
89
92
 
@@ -147,8 +150,12 @@ export default class ActivityPubEndpoint {
147
150
  const self = this;
148
151
 
149
152
  // Let Fedify handle NodeInfo data (/nodeinfo/2.1)
153
+ // Only pass GET/HEAD requests — POST/PUT/DELETE must not go through
154
+ // Fedify here, because fromExpressRequest() consumes the body stream,
155
+ // breaking Express body-parsed routes downstream (e.g. admin forms).
150
156
  router.use((req, res, next) => {
151
157
  if (!self._fedifyMiddleware) return next();
158
+ if (req.method !== "GET" && req.method !== "HEAD") return next();
152
159
  return self._fedifyMiddleware(req, res, next);
153
160
  });
154
161
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-activitypub",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
5
5
  "keywords": [
6
6
  "indiekit",