fix(app): sanitize workspace store filenames on Windows (#16703)
This commit is contained in:
parent
34328828ae
commit
f27ef595f6
3 changed files with 11 additions and 2 deletions
|
|
@ -104,4 +104,12 @@ describe("persist localStorage resilience", () => {
|
|||
const result = persistTesting.normalize({ value: "ok" }, '{"value":"\\x"}')
|
||||
expect(result).toBeUndefined()
|
||||
})
|
||||
|
||||
test("workspace storage sanitizes Windows filename characters", () => {
|
||||
const result = persistTesting.workspaceStorage("C:\\Users\\foo")
|
||||
|
||||
expect(result).toStartWith("opencode.workspace.")
|
||||
expect(result.endsWith(".dat")).toBeTrue()
|
||||
expect(/[:\\/]/.test(result)).toBeFalse()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue