How to accept application/csp-report as json in express and bodyParser?
<p>I'm trying to write a middleware to accept CSP report from browser. Browser issues <code>application/csp-report</code> as <code>Content-Type</code>. The request being posted is JSON format. Currently I use <code>bodyParser.text</code> to accept that Content-type. But I thought there might be a better way to accept <code>application/csp-report</code> as JSON in bodyParser. </p>

<p>Here's what I'm doing right now. </p>

<pre><code>app.use(bodyParser.json());
app.use(bodyParser.text({type: 'application/csp-report'}));
</code></pre>

<p>My question is how do I accept JSON request payload with <code>Content-Type</code> <code>application-csp-report</code>?</p>