Update packages/backend/src/core/activitypub/ApRequestService.ts

cherry picked from commit 129af06198

Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
This commit is contained in:
かっこかり 2024-08-17 18:25:46 +09:00 committed by あわわわとーにゅ
parent edf94b5452
commit b3d4f18175
No known key found for this signature in database
GPG key ID: 6AFBBF529601C1DB

View file

@ -202,7 +202,9 @@ export class ApRequestService {
});
//#region リクエスト先がhtmlかつactivity+jsonへのalternate linkタグがあるとき
if (res.headers.get('Content-type')?.startsWith('text/html;') && _followAlternate) {
const contentType = res.headers.get('content-type');
if ((contentType === 'text/html' || contentType?.startsWith('text/html;')) && _followAlternate) {
const html = await res.text();
const fragment = JSDOM.fragment(html);