0

I have set content security policy(CSP) in nodejs and it is getting applied to node. However, for the root html page CSP is not being applied. How can it be applied on html with the help of nodejs.

    app.use(function(req, res, next) {
    res.setHeader("Content-Security-Policy", "default-src 'self'; font-src 'self'; img-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; frame-src 'self'; connect-src 'self' ");
    return next();
});
Mrunall Veer
  • 101
  • 2
  • 3
  • 12

0 Answers0