diff --git a/.changeset/normalize-windows-path-suggestions.md b/.changeset/normalize-windows-path-suggestions.md new file mode 100644 index 0000000..70b172b --- /dev/null +++ b/.changeset/normalize-windows-path-suggestions.md @@ -0,0 +1,5 @@ +--- +"@jmfederico/pi-web": patch +--- + +Normalize allowed external path suggestions on Windows so configured absolute paths use platform separators consistently. diff --git a/src/server/workspaces/fileSuggestions.ts b/src/server/workspaces/fileSuggestions.ts index 739695e..441babe 100644 --- a/src/server/workspaces/fileSuggestions.ts +++ b/src/server/workspaces/fileSuggestions.ts @@ -206,8 +206,8 @@ function pathSuggestionPrefix(query: string): { directoryPrefix: string; searchP function appendRequestPath(base: string, name: string): string { if (base === "") return name; - if (hasTrailingPathSeparator(base)) return `${base}${name}`; if (isAbsolute(base) || win32.isAbsolute(base)) return join(base, name); + if (hasTrailingPathSeparator(base)) return `${base}${name}`; return `${base}/${name}`; }