Only accept HTML `<link rel="alternate">` on success
(cherry picked from commit 6ea48be84abdab66301a957c27dd5d84886dfb36)
This commit is contained in:
parent
9d3a331286
commit
59adc13b03
|
@ -205,7 +205,12 @@ export class ApRequestService {
|
|||
//#region リクエスト先がhtmlかつactivity+jsonへのalternate linkタグがあるとき
|
||||
const contentType = res.headers.get('content-type');
|
||||
|
||||
if ((contentType ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html' && _followAlternate === true) {
|
||||
if (
|
||||
res.status >= 200
|
||||
&& res.status <= 299
|
||||
&& (contentType ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html'
|
||||
&& _followAlternate === true
|
||||
) {
|
||||
const html = await res.text();
|
||||
const { window, happyDOM } = new Window({
|
||||
settings: {
|
||||
|
|
Loading…
Reference in New Issue