Fix: <link rel="alternate">
を追って照会するのはOKレスポンスが返却された場合のみに (#14627)
cherry picked from commit dd124a8aed
Co-authored-by: Julia Johannesen <julia@insertdomain.name>
Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
This commit is contained in:
parent
c441c4728f
commit
f5c0430bc9
1 changed files with 5 additions and 1 deletions
|
@ -204,7 +204,11 @@ 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 ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html' && _followAlternate) {
|
if (
|
||||||
|
res.ok &&
|
||||||
|
(contentType ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html' &&
|
||||||
|
_followAlternate
|
||||||
|
) {
|
||||||
const html = await res.text();
|
const html = await res.text();
|
||||||
try {
|
try {
|
||||||
const fragment = JSDOM.fragment(html);
|
const fragment = JSDOM.fragment(html);
|
||||||
|
|
Loading…
Reference in a new issue