(rawPath: string)
| 206 | * segments away — that folding is what would hide the attempt. |
| 207 | */ |
| 208 | export function isSafeRequestPath(rawPath: string): boolean { |
| 209 | const decoded = decodePath(rawPath); |
| 210 | if (decoded === null) return false; |
| 211 | return !decoded.split('/').includes('..'); |
| 212 | } |
| 213 | |
| 214 | /** |
| 215 | * Resolve a request path to a file inside the static asset root. |
no test coverage detected