Skip to content

Commit

Permalink
url validation fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dániel Gyenizse authored and adamsaghy committed Nov 20, 2023
1 parent 3f4e44a commit f6edab0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/core/utils/datatables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f6edab0

Please sign in to comment.