Co-Authored-By: RyotaK <49341894+Ry0taK@users.noreply.github.com>
This commit is contained in:
syuilo 2024-02-17 14:26:48 +09:00 committed by dakkar
parent fef7a7b99a
commit 6132bc3b3e
1 changed files with 1 additions and 1 deletions

View File

@ -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'); 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 { export function validateContentTypeSetAsJsonLD(response: Response): void {
const contentType = (response.headers.get('content-type') ?? '').toLowerCase(); const contentType = (response.headers.get('content-type') ?? '').toLowerCase();