From 6d4dc5ea206782333437fd41f472da955dca14b6 Mon Sep 17 00:00:00 2001 From: taichan <40626578+tai-cha@users.noreply.github.com> Date: Sat, 17 Aug 2024 19:51:56 +0900 Subject: [PATCH] Fix(beckend): html content-type detection on signedGet (#14424) cherry picked from commit bf8c42eecd3d645652ddd7e69b727ced2a15457d Co-authored-by: taichan <40626578+tai-cha@users.noreply.github.com> --- packages/backend/src/core/activitypub/ApRequestService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/core/activitypub/ApRequestService.ts b/packages/backend/src/core/activitypub/ApRequestService.ts index 5d3ae0a9e78a..3c988773bc88 100644 --- a/packages/backend/src/core/activitypub/ApRequestService.ts +++ b/packages/backend/src/core/activitypub/ApRequestService.ts @@ -204,7 +204,7 @@ export class ApRequestService { //#region リクエスト先がhtmlかつactivity+jsonへのalternate linkタグがあるとき const contentType = res.headers.get('content-type'); - if ((contentType === 'text/html' || contentType?.startsWith('text/html;')) && _followAlternate) { + if ((contentType ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html' && _followAlternate) { const html = await res.text(); const fragment = JSDOM.fragment(html);