(path)
| 8 | } |
| 9 | |
| 10 | function hasUnsafeRedirectCharacter(path) { |
| 11 | return Array.from(path).some((char) => { |
| 12 | const code = char.charCodeAt(0); |
| 13 | return char === "\\" || code <= 31 || code === 127; |
| 14 | }); |
| 15 | } |
| 16 | |
| 17 | export function safeLocalPath(path, fallbackPath = "/") { |
| 18 | if ( |