fix(backend/ActivityPubServerService): apOrHtml Constraintが正しく評価されない問題を修正 (MisskeyIO#869)

This commit is contained in:
あわわわとーにゅ 2025-01-05 02:39:50 +09:00 committed by GitHub
parent 6dcda9db5c
commit 88a361e622
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -524,8 +524,8 @@ export class ActivityPubServerService {
}, },
deriveConstraint(request: IncomingMessage) { deriveConstraint(request: IncomingMessage) {
const accepted = accepts(request).type(['html', ACTIVITY_JSON, LD_JSON]); const accepted = accepts(request).type(['html', ACTIVITY_JSON, LD_JSON]);
const isAp = typeof accepted === 'string' && !accepted.match(/html/); if (accepted === false) return null;
return isAp ? 'ap' : 'html'; return accepted !== 'html' ? 'ap' : 'html';
}, },
}); });