Skip to content

Commit

Permalink
add feature flag to not echo cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
XenGi authored and Ealenn committed Jul 16, 2022
1 parent 621effb commit 976b84e
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/response/request.js
Original file line number Diff line number Diff line change
@@ -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;
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
}
}

0 comments on commit 976b84e

Please sign in to comment.