UNPKG

347 BJavaScriptView Raw
1const mung = require('express-mung');
2const { kill } = require('q3-core-session');
3const runRedaction = require('./redact');
4
5exports.request = (req, res, next) => {
6 runRedaction(req, req, 'request');
7 next();
8};
9
10exports.response = mung.json((body, req) => {
11 runRedaction(req, body, 'response');
12 kill();
13
14 return body;
15});