forked from SmartDropLabs/smartdrop-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsp.test.ts
More file actions
19 lines (17 loc) · 759 Bytes
/
Copy pathcsp.test.ts
File metadata and controls
19 lines (17 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { describe, it, expect } from "vitest";
describe("CSP Headers", () => {
it("Content-Security-Policy includes default-src self", () => {
const CSP_POLICY = [
"default-src 'self'",
"script-src 'self' 'unsafe-eval'",
"style-src 'self' 'unsafe-inline'",
"connect-src 'self' https://horizon.stellar.org https://soroban-testnet.stellar.org https://soroban.stellar.org https://stellar.expert",
].join("; ");
expect(CSP_POLICY).toContain("default-src 'self'");
expect(CSP_POLICY).toContain("connect-src");
expect(CSP_POLICY).toContain("horizon.stellar.org");
expect(CSP_POLICY).toContain("soroban");
expect(CSP_POLICY).toContain("stellar.expert");
expect(CSP_POLICY).not.toContain("*");
});
});