From 4f0d7925b2510ab6a921f27db1f84f703037f1d6 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Tue, 17 Mar 2026 15:07:46 +0100 Subject: [PATCH] fix: strip invalid as:Endpoints type from Fedify actor serialization Fedify serializes the endpoints object with "type": "as:Endpoints" which is not a valid ActivityStreams 2.0 type. This causes browser.pub validation failures. Strip the type field in the JSON patching block. Confab-Link: http://localhost:8080/sessions/af5f8b45-6b8d-442d-8f25-78c326190709 --- lib/federation-bridge.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/federation-bridge.js b/lib/federation-bridge.js index 1295745..5b39051 100644 --- a/lib/federation-bridge.js +++ b/lib/federation-bridge.js @@ -89,6 +89,12 @@ async function sendFedifyResponse(res, response, request) { if (json.attachment && !Array.isArray(json.attachment)) { json.attachment = [json.attachment]; } + // WORKAROUND: Fedify serializes endpoints with "type": "as:Endpoints" + // which is not a valid AS2 type. The endpoints object should be a plain + // object with just sharedInbox/proxyUrl etc. Strip the invalid type. + if (json.endpoints && json.endpoints.type) { + delete json.endpoints.type; + } const patched = JSON.stringify(json); res.setHeader("content-length", Buffer.byteLength(patched)); res.end(patched);