Skip to content
Snippets Groups Projects
Verified Commit 6ea48be8 authored by Julia's avatar Julia
Browse files

Only accept HTML `<link rel="alternate">` on success

parent bc02b4ae
No related branches found
No related tags found
No related merge requests found
......@@ -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: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment