mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-21 16:41:56 +00:00
fix(ci): stabilize Windows path handling in sandbox tests
This commit is contained in:
@@ -154,6 +154,10 @@ describe("msteams media-helpers", () => {
|
||||
expect(isLocalPath("\\\\server\\share\\image.png")).toBe(true);
|
||||
});
|
||||
|
||||
it("returns true for Windows rooted paths", () => {
|
||||
expect(isLocalPath("\\tmp\\openclaw\\file.txt")).toBe(true);
|
||||
});
|
||||
|
||||
it("returns false for http URLs", () => {
|
||||
expect(isLocalPath("http://example.com/image.png")).toBe(false);
|
||||
expect(isLocalPath("https://example.com/image.png")).toBe(false);
|
||||
|
||||
@@ -69,6 +69,11 @@ export function isLocalPath(url: string): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Windows rooted path on current drive (e.g. \tmp\file.txt)
|
||||
if (url.startsWith("\\") && !url.startsWith("\\\\")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Windows drive-letter absolute path (e.g. C:\foo\bar.txt or C:/foo/bar.txt)
|
||||
if (/^[a-zA-Z]:[\\/]/.test(url)) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user