-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
33 lines (29 loc) · 896 Bytes
/
Copy pathnext.config.ts
File metadata and controls
33 lines (29 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import type { NextConfig } from "next";
const isDev = process.env.NODE_ENV === 'development';
const csp = `
default-src 'self';
script-src 'self' 'unsafe-inline' ${isDev ? "'unsafe-eval'" : ''} https://vercel.analytics.com;
style-src 'self' 'unsafe-inline';
font-src 'self';
img-src 'self' data: https://kofee.dev https://avatars.githubusercontent.com;
connect-src 'self' https://fkgxsgydromxcdivevet.supabase.co https://enough-tomcat-83590.upstash.io https://gist.githubusercontent.com;
frame-ancestors 'none';
`;
const nextConfig: NextConfig = {
reactStrictMode: true,
// adding headers for security (CSP)
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy",
value: csp.replace(/\n/g, ' ').trim(),
},
],
},
];
},
};
export default nextConfig;