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

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

* Update Changelog

* indent

---------

Co-authored-by: あわわわとーにゅ <17376330+u1-liquid@users.noreply.github.com>
This commit is contained in:
かっこかり
2025-01-08 19:35:09 +09:00
committed by GitHub
parent c49a13de65
commit 55713fcd65
2 changed files with 4 additions and 2 deletions

View File

@@ -519,8 +519,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';
},
});