Thread viewer for Bluesky

treat URLs other than http(s) as not valid

+2 -2
+2 -2
src/utils.ts
··· 17 17 18 18 export function isValidURL(url: string): boolean { 19 19 try { 20 - new URL(url); 21 - return true; 20 + let u = new URL(url); 21 + return (u.protocol == 'http:' || u.protocol == 'https:'); 22 22 } catch (error) { 23 23 console.error("Invalid URL: " + error); 24 24 return false;