Skip to content

Commit

Permalink
Update next.config.js (#900)
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui authored Nov 27, 2023
1 parent 3e649cb commit 7c60f9e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
/** @type {import('next').NextConfig} */
const path = require("path");

const ContentSecurityPolicy = `
const isDev = process.env.NODE_ENV === 'development';

let ContentSecurityPolicy = `
default-src 'self';
connect-src 'self' vitals.vercel-insights.com;`;

ContentSecurityPolicy += isDev ? `
script-src 'self' 'unsafe-eval' 'unsafe-inline';
style-src 'self' 'unsafe-inline';
connect-src 'self' vitals.vercel-insights.com;
` : `
script-src 'self';
style-src 'self';
`;

const securityHeaders = [
Expand Down

0 comments on commit 7c60f9e

Please sign in to comment.