From 82ca755362986b4d573fa12c5afc1f762b85c9fd Mon Sep 17 00:00:00 2001 From: Francis Li Date: Fri, 8 Dec 2017 11:50:53 -0800 Subject: [PATCH] Fixes #489, only logs request in development (#490) --- server/utils/requestsOfType.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/utils/requestsOfType.js b/server/utils/requestsOfType.js index d83d17dd..53f9d44e 100644 --- a/server/utils/requestsOfType.js +++ b/server/utils/requestsOfType.js @@ -4,10 +4,14 @@ header does not match `type` */ const requestsOfType = type => (req, res, next) => { - console.log(req); - console.log(req.get('content-type')); + if (process.env.NODE_ENV === 'development') { + console.log(req); + console.log(req.get('content-type')); + } if (req.get('content-type') != null && !req.is(type)) { - console.log('in requests of type error'); + if (process.env.NODE_ENV === 'development') { + console.log('in requests of type error'); + } return next({ statusCode: 406 }); // 406 UNACCEPTABLE }