(path, fallbackPath = "/")
| 15 | } |
| 16 | |
| 17 | export function safeLocalPath(path, fallbackPath = "/") { |
| 18 | if ( |
| 19 | typeof path !== "string" || |
| 20 | !path.startsWith("/") || |
| 21 | path.startsWith("//") || |
| 22 | hasUnsafeRedirectCharacter(path) |
| 23 | ) { |
| 24 | return fallbackPath; |
| 25 | } |
| 26 | return path; |
| 27 | } |
| 28 | |
| 29 | export function dataPointsApplicantPath(applicantId) { |
| 30 | return `/datapoints/applicant/${encodePathSegment(applicantId)}`; |
no test coverage detected