Skip to content

Commit

Permalink
improve redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-intuitem committed Oct 4, 2024
1 parent 357e1e0 commit 2703077
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/lib/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function formatScoreValue(value: number, max_score: number, fullDonut = f
}

export function getSecureRedirect(url: any): string {
const SECURE_REDIRECT_URL_REGEX = /^\/(?!.*\/\/)[^\s]*$/;
const SECURE_REDIRECT_URL_REGEX = /^\/[^/]/;
return typeof url === 'string' && SECURE_REDIRECT_URL_REGEX.test(url) ? url : '';
}

Expand Down

0 comments on commit 2703077

Please sign in to comment.