Skip to content

Commit

Permalink
Merge pull request #899 from intuitem/improve/redirect
Browse files Browse the repository at this point in the history
improve redirect
  • Loading branch information
nas-tabchiche authored Oct 4, 2024
2 parents 357e1e0 + 2703077 commit 6016284
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 6016284

Please sign in to comment.