From b3d4f18175418504965dfc64c1d26c16c5696629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sat, 17 Aug 2024 18:25:46 +0900 Subject: [PATCH] Update packages/backend/src/core/activitypub/ApRequestService.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cherry picked from commit 129af061989f535ab4c79f497ba55cc5f6bf0385 Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> --- packages/backend/src/core/activitypub/ApRequestService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/activitypub/ApRequestService.ts b/packages/backend/src/core/activitypub/ApRequestService.ts index b553708a8..5d3ae0a9e 100644 --- a/packages/backend/src/core/activitypub/ApRequestService.ts +++ b/packages/backend/src/core/activitypub/ApRequestService.ts @@ -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);