Skip to content

Commit 7be6605

Browse files
authored
fix(frontend): disable csp
While the Content Security Policy is a very useful tool to ensure security, the project is in development with no active users. At the moment as a developer, I'd like to focus on the actual product itself. I normally would make the CSP only apply in production, however this causes bugs that only appear in production. A developer's worst nightmare.
1 parent 62215b8 commit 7be6605

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

frontend/next.config.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ const { join } = require('node:path');
2121
// https://nextjs.org/docs/api-reference/next.config.js/introduction
2222
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
2323

24-
const ContentSecurityPolicy = `
25-
default-src 'self';
26-
script-src 'self';
27-
child-src authisfor.me ${process.env.BACKEND_SERVER || 'http://localhost:8000'};
28-
style-src 'self' authisfor.me ${process.env.BACKEND_SERVER || 'http://localhost:8000'};
29-
img-src 'self' namemc.com crafatar.com authisfor.me livzmc.net
30-
font-src 'self';
31-
`;
24+
// const ContentSecurityPolicy = `
25+
// default-src 'self';
26+
// script-src 'self';
27+
// child-src authisfor.me ${process.env.BACKEND_SERVER || 'http://localhost:8000'};
28+
// style-src 'self' authisfor.me ${process.env.BACKEND_SERVER || 'http://localhost:8000'};
29+
// img-src 'self' namemc.com crafatar.com authisfor.me livzmc.net
30+
// font-src 'self';
31+
// `;
3232

3333
const headers = [
3434
// This header controls DNS prefetching, allowing browsers to proactively perform domain name resolution on external links, images, CSS, JavaScript, and more.
@@ -57,10 +57,10 @@ const headers = [
5757
value: 'origin-when-cross-origin',
5858
},
5959
// CSP... Security. Modern. Cool. Yes.
60-
{
61-
key: 'Content-Security-Policy',
62-
value: ContentSecurityPolicy.replaceAll(/\s{2,}/g, ' ').trim(),
63-
},
60+
// {
61+
// key: 'Content-Security-Policy',
62+
// value: ContentSecurityPolicy.replaceAll(/\s{2,}/g, ' ').trim(),
63+
// },
6464
];
6565
const BuildingConfig = new Config({
6666
// NextJS Eslint setup, see https://nextjs.org/docs/basic-features/eslint

0 commit comments

Comments
 (0)