diff --git a/src/response/request.js b/src/response/request.js index 1b7800f..24d3c0f 100644 --- a/src/response/request.js +++ b/src/response/request.js @@ -1,9 +1,24 @@ const config = require('../nconf'); -module.exports = (req) => config.get('enable:request') ? { - params: req.params, - query: req.query, - cookies: req.cookies, - body: req.body, - headers: req.headers -} : undefined; \ No newline at end of file +module.exports = (req) => { + if (config.get('enable:request')) { + if (config.get('enable:cookies')) { + return { + params: req.params, + query: req.query, + cookies: req.cookies, + body: req.body, + headers: req.headers + } + } else { + return { + params: req.params, + query: req.query, + body: req.body, + headers: req.headers + } + } + } else { + return undefined + } +}