url validation fixed

This commit is contained in:
Dániel Gyenizse
2023-11-20 10:30:29 +01:00
committed by Adam Saghy
parent 3f4e44af49
commit f6edab0dd5
+2 -1
View File
@@ -160,7 +160,8 @@ export class Datatables {
public isValidUrl(urlString: string): boolean {
try {
return Boolean(new URL(urlString));
const url = new URL(urlString);
return url.protocol.startsWith("http") || url.protocol.startsWith("https");
} catch (e) {
return false;
}