mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 01:58:41 +01:00
Repair comments where the em-dash sweep left broken pairs, colon plus conjunction joins, and misaligned column lists. Block filesystem: in the pairing callback check, route both Pair views through the shared errorMessage() helper, and drop the SfcNode comments field the removed rule used. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
24 lines
676 B
TypeScript
24 lines
676 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { isCustomScheme } from "./pairCallback";
|
|
|
|
describe("isCustomScheme", () => {
|
|
it.each(["argosy://pair", "myapp:callback?x=1"])("accepts %s", (url) => {
|
|
expect(isCustomScheme(url)).toBe(true);
|
|
});
|
|
|
|
it.each([
|
|
"https://evil.example/cb",
|
|
"http://evil.example/cb",
|
|
"javascript:alert(1)",
|
|
"JavaScript:alert(1)",
|
|
"data:text/html,<script>alert(1)</script>",
|
|
"vbscript:msgbox(1)",
|
|
"blob:https://example.com/uuid",
|
|
"filesystem:https://example.com/temporary/cb",
|
|
"file:///etc/passwd",
|
|
"not a url",
|
|
])("rejects %s", (url) => {
|
|
expect(isCustomScheme(url)).toBe(false);
|
|
});
|
|
});
|