Node.js based forum software built for the modern web
fix: debug logs
Julian Lame8b947501fb4
diff --git a/src/activitypub/sendWorker.js b/src/activitypub/sendWorker.jsindex cc6e8b36b2..65e920c4b3 100644--- a/src/activitypub/sendWorker.js+++ b/src/activitypub/sendWorker.js@@ -13,6 +13,8 @@ const { fetch, Agent } = require('undici');const { check, lookup } = require('../ssrf');const winston = require('winston');+const DEBUG = process.env.AP_SEND_DEBUG === 'true';+const {importPrivateKey,genDraftSigningString,@@ -151,6 +153,13 @@ process.on('message', async (message) => {// Signconst headers = await sign(key, keyId, uri, digest);+ // Debug: log full request details+ if (DEBUG) {+ winston.debug(`[activitypub/send] REQUEST uri=${uri}`);+ winston.debug(`[activitypub/send] REQUEST headers=${JSON.stringify(headers)}`);+ winston.debug(`[activitypub/send] REQUEST payload=${payload.substring(0, 500)}`);+ }+// POST — redirect: 'manual' prevents SSRF via HTTP redirect// Combined signal: task-specific abort (shutdown) + 10s timeoutconst timeoutSignal = AbortSignal.timeout(10000);@@ -194,6 +203,12 @@ process.on('message', async (message) => {bodyText = await response.text();} catch (e) { /* ignore */ }+ // Debug: log full response details+ if (DEBUG) {+ winston.debug(`[activitypub/send] RESPONSE status=${response.status} headers=${JSON.stringify(Object.fromEntries(response.headers.entries()))}`);+ winston.debug(`[activitypub/send] RESPONSE body=${bodyText.substring(0, 1000)}`);+ }+process.send({type: 'result',id,