Skip to content

Commit

Permalink
Fix(beckend): html content-type detection on signedGet (misskey-dev#1…
Browse files Browse the repository at this point in the history
…4424)

cherry picked from commit bf8c42e

Co-authored-by: taichan <[email protected]>
  • Loading branch information
tai-cha authored and u1-liquid committed Dec 24, 2024
1 parent b3d4f18 commit 6d4dc5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/backend/src/core/activitypub/ApRequestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 6d4dc5e

Please sign in to comment.