summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2024-02-17 14:26:48 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2024-02-17 14:26:48 +0900
commit01de1519dda0188121d4d1558310beaa24dbe8af (patch)
tree62ca693a90d6b95a741fb4b68eb3fe74b16f210e
parentUpdate package.json (diff)
downloadmisskey-01de1519dda0188121d4d1558310beaa24dbe8af.tar.gz
misskey-01de1519dda0188121d4d1558310beaa24dbe8af.tar.bz2
misskey-01de1519dda0188121d4d1558310beaa24dbe8af.zip
fix of 9a70ce8f5ea9df00001894809f5ce7bc69b14c8a
Co-Authored-By: RyotaK <49341894+Ry0taK@users.noreply.github.com>
-rw-r--r--packages/backend/src/core/activitypub/misc/validator.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/backend/src/core/activitypub/misc/validator.ts b/packages/backend/src/core/activitypub/misc/validator.ts
index 6ba14a222f..690beeffef 100644
--- a/packages/backend/src/core/activitypub/misc/validator.ts
+++ b/packages/backend/src/core/activitypub/misc/validator.ts
@@ -20,7 +20,7 @@ export function validateContentTypeSetAsActivityPub(response: Response): void {
throw new Error('Validate content type of AP response: Content type is not application/activity+json or application/ld+json');
}
-const plusJsonSuffixRegex = /(application|text)\/[a-zA-Z0-9\.\-\+]+\+json/;
+const plusJsonSuffixRegex = /^\s*(application|text)\/[a-zA-Z0-9\.\-\+]+\+json\s*(;|$)/;
export function validateContentTypeSetAsJsonLD(response: Response): void {
const contentType = (response.headers.get('content-type') ?? '').toLowerCase();