Skip to content

Commit

Permalink
Always log when a request is intercepted
Browse files Browse the repository at this point in the history
  • Loading branch information
Cawllec committed Sep 19, 2019
1 parent c65ea2d commit 6520512
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ paths.forEach(pathDef => {

function getHandler(pathDef) {
return (req, res) => {
console.log(`Interception:`)
console.log(` Of type: ${req.method}`);
console.log(` From host: ${req.hostname}`);
console.log(` To route: ${req.originalUrl}`);
if (pathDef['parse']) {
parseRequest(req)
}
Expand Down Expand Up @@ -99,10 +103,6 @@ function saveRequest(pathDef, data) {
}

function parseRequest(req) {
console.log(`Interception:`)
console.log(` Of type: ${req.method}`);
console.log(` From host: ${req.hostname}`);
console.log(` To route: ${req.originalUrl}`);
console.log(` With headers:`);
console.log(util.inspect(req.headers, {depth: null}));
if (req.body) {
Expand Down

0 comments on commit 6520512

Please sign in to comment.