From 2bb6e48a8b7c1f7a8c51a21a498843135162879e Mon Sep 17 00:00:00 2001 From: Federico Jaramillo Martinez Date: Tue, 23 Jun 2026 20:03:44 +0200 Subject: [PATCH] fix: normalize Windows path suggestions --- .changeset/normalize-windows-path-suggestions.md | 5 +++++ src/server/workspaces/fileSuggestions.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/normalize-windows-path-suggestions.md 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}`; }