Skip to content

Commit

Permalink
Add CSP report-uri to demo reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
mgillam committed May 13, 2020
1 parent dc703e7 commit c321e24
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions client.csp.demo/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ global.cspDirectives = { 'default-src': `'self'`, 'use-default-src': 'on' }
const globalCsp = (req, res, next) => {
if(global.csp.trim().length > 0) {
res.set('Content-Security-Policy', global.csp.replace(/\$nonce/g, res.nonce))
res.set('Content-Security-Policy-Report-Only', 'report-uri /csp-report; ' + global.csp.replace(/\$nonce/g, res.nonce))
}
next()
}
Expand Down

0 comments on commit c321e24

Please sign in to comment.