fix: Windows File-Explorer – Backslashes und Laufwerksübersicht

Pfade werden auf Windows nativ mit Backslashes zurückgegeben statt zu Forward-Slashes konvertiert. Navigation von Laufwerk (C:) zurück zur Laufwerksliste ermöglicht.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MelekiandClaude Opus 4.6 committed 2026-04-17 09:37:06 +02:00
1 parent 53cee67bef
commit eccecf8f14
2 files changed
+14 -12

No files matched your search

+4 -4
View File
@@ -304,7 +304,7 @@ public static class WorkspaceEndpoint
{
var drives = System.IO.DriveInfo.GetDrives()
.Where(d => d.IsReady)
.Select(d => new { name = d.Name.TrimEnd('\\'), path = d.Name.Replace('\\', '/'), type = "dir" })
.Select(d => new { name = d.Name.TrimEnd('\\'), path = d.Name.TrimEnd('\\'), type = "dir" })
.ToList<object>();
await ctx.Response.WriteAsJsonAsync(new { current = "", entries = drives });
return;
@@ -326,12 +326,12 @@ public static class WorkspaceEndpoint
{
var name = Path.GetFileName(dir);
if (IgnoredDirs.Contains(name)) continue;
entries.Add(new { name, path = dir.Replace('\\', '/'), type = "dir" });
entries.Add(new { name, path = dir, type = "dir" });
}
}
catch (UnauthorizedAccessException) { }
await ctx.Response.WriteAsJsonAsync(new { current = targetPath.Replace('\\', '/'), entries });
await ctx.Response.WriteAsJsonAsync(new { current = targetPath, entries });
}
private static async Task HandleBrowseMkdir(HttpContext ctx)
@@ -362,7 +362,7 @@ public static class WorkspaceEndpoint
}
Directory.CreateDirectory(targetPath);
await ctx.Response.WriteAsJsonAsync(new { path = targetPath.Replace('\\', '/'), created = true });
await ctx.Response.WriteAsJsonAsync(new { path = targetPath, created = true });
}
private static async Task HandleRawFile(HttpContext ctx)