fix: opening balance direction, safe return paths, backup failure detection, review fixes
- opening balance: "person 2 owes person 1" was stored the wrong way round - retour param: reject backslash/control chars (open redirect) - backup: pipefail + check dump completeness, failed dumps no longer logged OK - deleting a recurring occurrence marks it skipped so sync does not recreate it - editing a charge regenerates future occurrences of incomes allocated to it - settlements (incl. opening balance) listed in settings and deletable Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a0bcea4eb1
commit
5b402691f0
15 files changed
+222
-15
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { safeReturn } from "@/lib/safe-return";
|
||||
|
||||
describe("safeReturn", () => {
|
||||
it("keeps internal paths with their query string", () => {
|
||||
expect(safeReturn("/operations?m=2026-10&q=a", "/")).toBe("/operations?m=2026-10&q=a");
|
||||
expect(safeReturn("/", "/x")).toBe("/");
|
||||
});
|
||||
|
||||
it("falls back for anything that could leave the site", () => {
|
||||
for (const bad of [undefined, "", "https://evil.com", "//evil.com", "/\\evil.com", "/%09/evil.com", "\t//evil.com", "javascript:alert(1)", "/\t/evil.com"]) {
|
||||
expect(safeReturn(bad, "/fallback")).toBe("/fallback");
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user