From eaaf591d2eb7d10bb3e1e0100d20fda8b4b19afe Mon Sep 17 00:00:00 2001 From: Matthew Volk Date: Mon, 17 Jun 2024 13:28:09 -0500 Subject: [PATCH] temp: fix frame ancestor error by removing csp @todo: instead of removing csp, we should make it less lax/configurable for embedding in iframes such as makeswift --- next.config.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/next.config.js b/next.config.js index 801163c..4200d42 100644 --- a/next.config.js +++ b/next.config.js @@ -5,11 +5,12 @@ const createNextIntlPlugin = require('next-intl/plugin'); const withMakeswift = createWithMakeswift(); const withNextIntl = createNextIntlPlugin(); -const cspHeader = ` - base-uri 'self'; - form-action 'self'; - frame-ancestors 'none'; -`; +// @todo relax csp for makeswift embedding +// const cspHeader = ` +// base-uri 'self'; +// form-action 'self'; +// frame-ancestors 'none'; +// `; /** @type {import('next').NextConfig} */ const nextConfig = { @@ -26,19 +27,19 @@ const nextConfig = { }, // default URL generation in BigCommerce uses trailing slash trailingSlash: process.env.TRAILING_SLASH !== 'false', - async headers() { - return [ - { - source: '/(.*)', - headers: [ - { - key: 'Content-Security-Policy', - value: cspHeader.replace(/\n/g, ''), - }, - ], - }, - ]; - }, + // async headers() { + // return [ + // { + // source: '/(.*)', + // headers: [ + // { + // key: 'Content-Security-Policy', + // value: cspHeader.replace(/\n/g, ''), + // }, + // ], + // }, + // ]; + // }, }; module.exports = withMakeswift(withNextIntl(nextConfig));