Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

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

Ruggero Tomaselli6bfd87b68ea3
diff --git a/studio/next.config.js b/studio/next.config.js
index 99b4b7d2513..e9ff06245e1 100644
--- a/studio/next.config.js
+++ b/studio/next.config.js
@@ -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',