fix: allow file tree access on Windows cross-drive project paths
FileTree component was not passing baseDir to the file API, causing it to fall back to restricting access to the home directory. On Windows, projects on a different drive (e.g., D:\) were blocked with 403. Changes: - FileTree now passes workingDirectory as baseDir parameter - File API routes no longer require baseDir to be under homeDir (allows cross-drive access on Windows) - Still prevents using filesystem root as baseDir for safety - Add isRootPath() utility for root path detection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
6aca8c3870
commit
d446da9717
4 files changed
+23
-17
No files matched your search
@@ -118,7 +118,7 @@ export function FileTree({ workingDirectory, onFileSelect, onFileAdd }: FileTree
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await fetch(
|
||||
`/api/files?dir=${encodeURIComponent(workingDirectory)}&depth=4`
|
||||
`/api/files?dir=${encodeURIComponent(workingDirectory)}&baseDir=${encodeURIComponent(workingDirectory)}&depth=4`
|
||||
);
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
|
||||
Reference in new issue
Block a user