From f5c0430bc9b833561915035bee12c35bbd159010 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=82=E3=82=8F=E3=82=8F=E3=82=8F=E3=81=A8=E3=83=BC?=
=?UTF-8?q?=E3=81=AB=E3=82=85?=
<17376330+u1-liquid@users.noreply.github.com>
Date: Wed, 25 Dec 2024 03:45:35 +0900
Subject: [PATCH] =?UTF-8?q?Fix:=20``=E3=82=92?=
=?UTF-8?q?=E8=BF=BD=E3=81=A3=E3=81=A6=E7=85=A7=E4=BC=9A=E3=81=99=E3=82=8B?=
=?UTF-8?q?=E3=81=AE=E3=81=AFOK=E3=83=AC=E3=82=B9=E3=83=9D=E3=83=B3?=
=?UTF-8?q?=E3=82=B9=E3=81=8C=E8=BF=94=E5=8D=B4=E3=81=95=E3=82=8C=E3=81=9F?=
=?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AE=E3=81=BF=E3=81=AB=20(#14627)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
cherry picked from commit dd124a8aedb34a1112405fa68bd5daaa96fdc882
Co-authored-by: Julia Johannesen
Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
---
packages/backend/src/core/activitypub/ApRequestService.ts | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/packages/backend/src/core/activitypub/ApRequestService.ts b/packages/backend/src/core/activitypub/ApRequestService.ts
index 4810fe9e4..fe58b42cf 100644
--- a/packages/backend/src/core/activitypub/ApRequestService.ts
+++ b/packages/backend/src/core/activitypub/ApRequestService.ts
@@ -204,7 +204,11 @@ export class ApRequestService {
//#region リクエスト先がhtmlかつactivity+jsonへのalternate linkタグがあるとき
const contentType = res.headers.get('content-type');
- if ((contentType ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html' && _followAlternate) {
+ if (
+ res.ok &&
+ (contentType ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html' &&
+ _followAlternate
+ ) {
const html = await res.text();
try {
const fragment = JSDOM.fragment(html);