enhance(backend): プロフィールのリンク検証にtry-catchを追加 (#13882)
* enhance(backend): プロフィールのリンク検証にtry-catchを追加
* ✌️
This commit is contained in:
parent
1b81ca4563
commit
805a11aadb
1 changed files with 21 additions and 15 deletions
|
@ -498,6 +498,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
private async verifyLink(url: string, user: MiLocalUser) {
|
private async verifyLink(url: string, user: MiLocalUser) {
|
||||||
if (!safeForSql(url)) return;
|
if (!safeForSql(url)) return;
|
||||||
|
|
||||||
|
try {
|
||||||
const html = await this.httpRequestService.getHtml(url);
|
const html = await this.httpRequestService.getHtml(url);
|
||||||
|
|
||||||
const { window } = new JSDOM(html);
|
const { window } = new JSDOM(html);
|
||||||
|
@ -519,5 +520,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
})
|
})
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.close();
|
||||||
|
} catch (err) {
|
||||||
|
// なにもしない
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue