Update CSP move it into next config

This commit is contained in:
Jackson Harper 2023-06-13 22:12:32 +08:00
parent 1ea0291e75
commit e7fab85194

View file

@ -1,3 +1,17 @@
const ContentSecurityPolicy = `
default-src 'none';
base-uri 'self';
block-all-mixed-content;
connect-src 'self' api-prod.omnivore.app api-demo.omnivore.app;
font-src 'self';
form-action 'self' api-prod.omnivore.app api-demo.omnivore.app;
frame-ancestors 'none';
frame-src 'none';
manifest-src 'self';
script-src script-src 'self' 'unsafe-inline';
style-src 'self' 'unsafe-inline';
`
const moduleExports = {
images: {
domains: [
@ -24,6 +38,12 @@ const moduleExports = {
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/mobile-auth/:path*`,
},
],
Headers: [
{
key: 'Content-Security-Policy',
value: ContentSecurityPolicy.replace(/\s{2,}/g, ' ').trim(),
},
],
async redirects() {
return [
{