Fix(beckend): html content-type detection on signedGet (#14424)

cherry picked from commit bf8c42eecd

Co-authored-by: taichan <40626578+tai-cha@users.noreply.github.com>
This commit is contained in:
taichan 2024-08-17 19:51:56 +09:00 committed by あわわわとーにゅ
parent b3d4f18175
commit 6d4dc5ea20
No known key found for this signature in database
GPG key ID: 6AFBBF529601C1DB

View file

@ -204,7 +204,7 @@ export class ApRequestService {
//#region リクエスト先がhtmlかつactivity+jsonへのalternate linkタグがあるとき //#region リクエスト先がhtmlかつactivity+jsonへのalternate linkタグがあるとき
const contentType = res.headers.get('content-type'); 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 html = await res.text();
const fragment = JSDOM.fragment(html); const fragment = JSDOM.fragment(html);