Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ export default {
loader: 'custom',
},
async headers() {
// set Content-Security-Policy header for manifest.json and all other routes to allow this app to be embedded in iframes by Safe
const cspConfig = {
key: 'Content-Security-Policy',
value:
'frame-ancestors "self" https://app.safe.global https://app.safe.protofire.io;',
}

return [
{
source: '/manifest.json',
Expand All @@ -80,11 +87,7 @@ export default {
key: 'Access-Control-Allow-Headers',
value: 'X-Requested-With, content-type, Authorization',
},
{
key: 'Content-Security-Policy',
value:
'frame-ancestors "self" https://app.safe.global https://app.safe.protofire.io;',
},
cspConfig,
],
},
{
Expand All @@ -107,6 +110,7 @@ export default {
key: 'Referrer-Policy',
value: 'same-origin',
},
cspConfig,
],
},
]
Expand Down
Loading