Skip to content

Commit 57ed872

Browse files
gautamg795Convex, Inc.
authored and
Convex, Inc.
committed
add cors headers to self-hosted-dashboard if env var is set (#35869)
GitOrigin-RevId: 22bfd4caa3b10dd47d0b8bd2e118232a67149671
1 parent f8922bb commit 57ed872

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,27 @@ const optionsForExport = {
3737
unoptimized: true,
3838
},
3939
};
40+
4041
const optionsForBuild = {
4142
output: "standalone",
4243
async headers() {
4344
return [
4445
{
4546
// Apply these headers to all routes in your application.
4647
source: "/:path*",
47-
headers: securityHeaders,
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,
4861
},
4962
];
5063
},

0 commit comments

Comments
 (0)