fix: Remove 'upgrade-insecure-requests' for self-host

This commit is contained in:
Ruggero Tomaselli authored and Han Qiao committed 2023-01-30 11:36:24 +08:00
1 parent 757c1302eb
commit 6bfd87b68e
1 file changed
+9 -6
+9 -6
View File
@@ -12,6 +12,14 @@ const withTM = require('next-transpile-modules')(['ui', 'common'])
// https://nextjs.org/docs/api-reference/next.config.js/introduction
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
const csp = [
"frame-ancestors 'none';",
// IS_PLATFORM
process.env.NEXT_PUBLIC_IS_PLATFORM === 'true' ? 'upgrade-insecure-requests;' : '',
]
.filter(Boolean)
.join(' ')
const nextConfig = {
async redirects() {
return [
@@ -137,12 +145,7 @@ const nextConfig = {
},
{
key: 'Content-Security-Policy',
value: `
frame-ancestors 'none';
upgrade-insecure-requests;
`
.replace(/\s{2,}/g, ' ')
.trim(),
value: csp,
},
{
key: 'Referrer-Policy',