I tried this method:
app.Use(async (context, next) =>
{
context.Response.Headers.Add("Content-Security-Policy", "frame-ancestors 'self' https://localhost:5000 https://*.yourdomain.com");
context.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN");
await next();
});
by adding it to my startup file as suggested. I was expecting to see these security headers rendered in my header of my site but they aren't. I was assuming it would be rendered something like this: <meta http-equiv="Content-Security-Policy" content="script-src 'self'; style-src 'self'; image-src 'self;">
does the suggested code not do that or does this code just allow the site to still be rendered correctly in preview mode within the kentico CMS?