From 6b0a715d94617fad350a33f0e6c825dc3ef41571 Mon Sep 17 00:00:00 2001 From: "Chris M. Vasseng" Date: Tue, 12 Nov 2024 12:30:54 +0100 Subject: [PATCH] Default errors to 400 --- lib/server/error.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/server/error.js b/lib/server/error.js index e7978c9e..eaeef9f9 100644 --- a/lib/server/error.js +++ b/lib/server/error.js @@ -33,7 +33,7 @@ const logErrorMiddleware = (error, req, res, next) => { const returnErrorMiddleware = (error, req, res, next) => { // Gather all requied information for the response const { statusCode: stCode, status, message, stack } = error; - const statusCode = stCode || status || 500; + const statusCode = stCode || status || 400; // Set and return response res.status(statusCode).json({ statusCode, message, stack });