parent
c4df272b1c
commit
82ca755362
1 changed files with 7 additions and 3 deletions
|
@ -4,10 +4,14 @@
|
|||
header does not match `type`
|
||||
*/
|
||||
const requestsOfType = type => (req, res, next) => {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log(req);
|
||||
console.log(req.get('content-type'));
|
||||
}
|
||||
if (req.get('content-type') != null && !req.is(type)) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log('in requests of type error');
|
||||
}
|
||||
return next({ statusCode: 406 }); // 406 UNACCEPTABLE
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue