Skip to content

Commit 6520512

Browse files
committed
Always log when a request is intercepted
1 parent c65ea2d commit 6520512

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ paths.forEach(pathDef => {
5757

5858
function getHandler(pathDef) {
5959
return (req, res) => {
60+
console.log(`Interception:`)
61+
console.log(` Of type: ${req.method}`);
62+
console.log(` From host: ${req.hostname}`);
63+
console.log(` To route: ${req.originalUrl}`);
6064
if (pathDef['parse']) {
6165
parseRequest(req)
6266
}
@@ -99,10 +103,6 @@ function saveRequest(pathDef, data) {
99103
}
100104

101105
function parseRequest(req) {
102-
console.log(`Interception:`)
103-
console.log(` Of type: ${req.method}`);
104-
console.log(` From host: ${req.hostname}`);
105-
console.log(` To route: ${req.originalUrl}`);
106106
console.log(` With headers:`);
107107
console.log(util.inspect(req.headers, {depth: null}));
108108
if (req.body) {

0 commit comments

Comments
 (0)