Skip to content

Commit

Permalink
Add CSP headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjduffy committed Dec 3, 2021
1 parent 88ed314 commit 9a3e956
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion next.config.js
@@ -1,5 +1,16 @@
const { RetryChunkLoadPlugin } = require("webpack-retry-chunk-load-plugin");

const self = "'self' https://*.replay.io wss://*.replay.io";
const csp = `
frame-ancestors ${self};
default-src ${self};
style-src ${self} 'unsafe-inline';
script-src ${self} 'unsafe-eval' data: blob: https://*.stripe.com https://*.lr-ingest.io https://*.intercom.io https://*.intercomcdn.com https://*.launchdarkly.com;
connect-src ${self} https://webreplay.us.auth0.com https://*.launchdarkly.com/ https://*.stripe.com https://*.intercom.io wss://*.intercom.io;
img-src ${self} https: data:;
frame-src ${self} https://webreplay.us.auth0.com https://*.stripe.com;
`;

module.exports = {
productionBrowserSourceMaps: true,

Expand All @@ -14,7 +25,7 @@ module.exports = {
},
{
key: "Content-Security-Policy",
value: "frame-ancestors 'self' https://*.replay.io/",
value: csp.split("\n").join(""),
},
],
},
Expand Down

0 comments on commit 9a3e956

Please sign in to comment.