From 0b36126854fc387151ccb3daad8608a74b6da945 Mon Sep 17 00:00:00 2001 From: Frank Winter Date: Wed, 2 Oct 2019 22:18:54 +0200 Subject: [PATCH] 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 --- server/utils/requestsOfType.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/utils/requestsOfType.js b/server/utils/requestsOfType.js index 5aac7b8c..43bfeb1d 100644 --- a/server/utils/requestsOfType.js +++ b/server/utils/requestsOfType.js @@ -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) {