mirror of
https://codeberg.org/yeentown/barkey
synced 2024-12-29 06:21:05 +00:00
Only accept HTML <link rel="alternate">
on success
This commit is contained in:
parent
bc02b4ae1f
commit
6ea48be84a
1 changed files with 6 additions and 1 deletions
|
@ -207,7 +207,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 = new Window({
|
||||
settings: {
|
||||
|
|
Loading…
Reference in a new issue