From 667dce4a94b8b3ce7adff939ad1ca4ea47975eda Mon Sep 17 00:00:00 2001 From: Louis Laureys Date: Sat, 17 Aug 2019 00:58:26 +0200 Subject: [PATCH] 404 code to 200 code with an error code string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 404 error without an error code string is inconsistent when compared to all other methods. While on that topic, is there any reason for not using the right http response codes Sorry for all the issues 😁. Knowing me there's more to come. I'll get on the SHA password encryption as soon as I get my application working enough. --- lib/api/filters.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/api/filters.js b/lib/api/filters.js index 34a51aa4..17829c81 100644 --- a/lib/api/filters.js +++ b/lib/api/filters.js @@ -475,9 +475,9 @@ module.exports = (db, server) => { } if (!r.deletedCount) { - res.status(404); res.json({ - error: 'Filter was not found' + error: 'Filter was not found', + code: 'FilterNotFound' }); return next(); }