mirror of
https://git.boykissers.com/pawkey/pawkey-sk.git
synced 2025-12-20 12:14:18 +00:00
use shared URL verification in verifyLinkFields
This commit is contained in:
@@ -10,7 +10,7 @@ type Field = { name: string, value: string };
|
|||||||
|
|
||||||
export async function verifyFieldLinks(fields: Field[], profile_url: string, httpRequestService: HttpRequestService): Promise<string[]> {
|
export async function verifyFieldLinks(fields: Field[], profile_url: string, httpRequestService: HttpRequestService): Promise<string[]> {
|
||||||
const verified_links = [];
|
const verified_links = [];
|
||||||
for (const field_url of fields.filter(x => URL.canParse(x.value) && ['http:', 'https:'].includes((new URL(x.value).protocol)))) {
|
for (const field_url of fields) {
|
||||||
try {
|
try {
|
||||||
const html = await httpRequestService.getHtml(field_url.value);
|
const html = await httpRequestService.getHtml(field_url.value);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user