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) {
const accepted = accepts(request).type(['html', ACTIVITY_JSON, LD_JSON]);
const isAp = typeof accepted === 'string' && !accepted.match(/html/);
return isAp ? 'ap' : 'html';
if (accepted === false) return null;
return accepted !== 'html' ? 'ap' : 'html';
},
});