Created
June 17, 2014 08:37
-
-
Save oroce/361d1abda643d1b6a95d to your computer and use it in GitHub Desktop.
parse csp report in express
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var bodyParser = require('body-parser'); | |
// chrome sends application/csp-report | |
// firefox sends application/json | |
// it seems chrome is doing it well: https://w3c.github.io/webappsec/specs/content-security-policy/ | |
app.use(bodyParser.json({ | |
type: ['json', 'application/csp-report'] | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you 👍