mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-31 04:07:52 +00:00
The GBRAIN_HOME validator rejected every valid Windows path (`C:\\Users\\...`,
`D:\\gbrain`, etc.) because it used `trimmed.startsWith('/')` to check for
absoluteness — only POSIX absolute paths pass that. `path.isAbsolute()` is
the cross-platform check.
Same fix for the `..` traversal check: split on both `/` and `\` so
Windows path separators don't sneak `..` through.
Closes #1019. Cherry-picked from PR #1083.
Co-Authored-By: sharziki <sharziki@users.noreply.github.com>