Changeset 89cc8c4 in Klonkt
- Timestamp:
- 06/28/2026 12:03:28 PM (2 months ago)
- Branches:
- main
- Children:
- a995698
- Parents:
- 5b1115b
- File:
-
- 1 edited
-
src/routes/activitypub.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/activitypub.js
r5b1115b r89cc8c4 22 22 // The whole fediverse layer can be turned off (solo "no federation" mode): 23 23 // then /ap/*, WebFinger and NodeInfo are simply gone — the site is undiscoverable 24 // and unfederatable. 25 router.use((req, res, next) => { if (!apEnabled()) return res.status(404).end(); next(); }); 24 // and unfederatable. CRITICAL: this router is mounted at root (app.use(apRoutes)), so a 25 // blanket res.status(404) here ran for EVERY request and 404'd the whole site when AP was 26 // off. Use next('router') to SKIP this router entirely and let the normal routes handle it 27 // (the /ap/* paths then fall through to the app's normal 404, which is correct). 28 router.use((req, res, next) => { if (!apEnabled()) return next('router'); next(); }); 26 29 // Generous per-IP baseline over all /ap/* (reads). The inbox POST gets an 27 30 // additional, tighter cap inline (it triggers outbound fetches).
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)