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 committed Nov 17, 2023
1 parent d8a279f commit 0503744
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 0503744

Please sign in to comment.