Change DELETE request for projects Fixes #1165 (#1172)

* Change DELETE request for projects

* fixes #1165, by updating requestsOfType to check for null or undefined values

* remove unnecessary whitespace changes
This commit is contained in:
Frank Winter 2019-10-02 22:18:54 +02:00 committed by Cassie Tarakajian
parent 7e815b1dcb
commit 0b36126854

View file

@ -4,7 +4,7 @@
header does not match `type`
*/
const requestsOfType = type => (req, res, next) => {
const hasContentType = req.get('content-type') !== null;
const hasContentType = req.get('content-type') !== undefined && req.get('content-type') !== null;
const isCorrectType = req.is(type) === null || req.is(type) === type;
if (hasContentType && !isCorrectType) {