Skip to content

Commit a76ff9d

Browse files
NicolappsConvex, Inc.
authored andcommitted
Disallow iframe protections in embedded dashboard (#35992)
GitOrigin-RevId: 2cf994b9a3a0f91aed90a6ca4bd62f3a1776f6c9
1 parent 2de5b4a commit a76ff9d

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

npm-packages/dashboard-self-hosted/next.config.js

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,10 @@ const securityHeaders = [
1717
key: "X-XSS-Protection",
1818
value: "1; mode=block",
1919
},
20-
{
21-
key: "X-Frame-Options",
22-
value: "SAMEORIGIN",
23-
},
2420
{
2521
key: "Referrer-Policy",
2622
value: "origin-when-cross-origin",
2723
},
28-
{
29-
key: "Content-Security-Policy",
30-
value: ContentSecurityPolicy.replace(/\s{2,}/g, " ").trim(),
31-
},
3224
];
3325

3426
const optionsForExport = {
@@ -45,19 +37,30 @@ const optionsForBuild = {
4537
{
4638
// Apply these headers to all routes in your application.
4739
source: "/:path*",
48-
headers: process.env.EMBEDDED_CORS_HEADERS
49-
? [
50-
...securityHeaders,
51-
{
52-
key: "Cross-Origin-Resource-Policy",
53-
value: "cross-origin",
54-
},
55-
{
56-
key: "Cross-Origin-Embedder-Policy",
57-
value: "require-corp",
58-
},
59-
]
60-
: securityHeaders,
40+
headers: [
41+
...securityHeaders,
42+
...(process.env.EMBEDDED_CORS_HEADERS
43+
? [
44+
{
45+
key: "Cross-Origin-Resource-Policy",
46+
value: "cross-origin",
47+
},
48+
{
49+
key: "Cross-Origin-Embedder-Policy",
50+
value: "require-corp",
51+
},
52+
]
53+
: [
54+
{
55+
key: "X-Frame-Options",
56+
value: "SAMEORIGIN",
57+
},
58+
{
59+
key: "Content-Security-Policy",
60+
value: ContentSecurityPolicy.replace(/\s{2,}/g, " ").trim(),
61+
},
62+
]),
63+
],
6164
},
6265
];
6366
},

0 commit comments

Comments
 (0)