From 5ba3d8f2b3a25e2264b7513786ed356d8a139183 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sun, 3 Sep 2023 22:40:10 +0200 Subject: [PATCH] Moved invalid X-Forwader-For header handler --- svr.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/svr.js b/svr.js index 4c40707..3a21f91 100644 --- a/svr.js +++ b/svr.js @@ -4032,6 +4032,13 @@ if (!cluster.isPrimary) { return; } + // Check for invalid X-Forwarded-For header + if(!isForwardedValid) { + serverconsole.errmessage("X-Forwarded-For header is invalid."); + callServerError(400); + return; + } + // Sanitize URL var sanitizedHref = sanitizeURL(href); @@ -4068,13 +4075,6 @@ if (!cluster.isPrimary) { return; } } - - // Check for invalid X-Forwarded-For header - if(!isForwardedValid) { - serverconsole.errmessage("X-Forwarded-For header is invalid."); - callServerError(400); - return; - } // Handle redirects to HTTPS if(secure && !fromMain && !disableNonEncryptedServer && !disableToHTTPSRedirect) {