Fixes #489, only logs request in development (#490)

This commit is contained in:
Francis Li 2017-12-08 11:50:53 -08:00 committed by Cassie Tarakajian
parent c4df272b1c
commit 82ca755362

View file

@ -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
}