From cbd3ab0cd0710070ae290ffac2cec16fea8eb961 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Fri, 23 Aug 2024 22:19:41 +0200 Subject: [PATCH] Adapted redirectes middleware function to new SVR.JS API. --- src/middleware/redirects.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/middleware/redirects.js b/src/middleware/redirects.js index 9bc6e48..53808b3 100644 --- a/src/middleware/redirects.js +++ b/src/middleware/redirects.js @@ -6,14 +6,14 @@ module.exports = (req, res, logFacilities, config, next) => { if (config.secure && !fromMain && !config.disableNonEncryptedServer && !config.disableToHTTPSRedirect) { var hostx = req.headers.host; if (hostx === undefined) { - serverconsole.errmessage("Host header is missing."); - callServerError(400); + logFacilities.errmessage("Host header is missing."); + res.error(400); return; } if (req.isProxy) { - callServerError(501); - serverconsole.errmessage("This server will never be a proxy."); + res.error(501); + logFacilities.errmessage("This server will never be a proxy."); return; }