From ccffa36d6c1daa69329ed76f59a0350d968ebb1a Mon Sep 17 00:00:00 2001 From: ByteBuf <104734722+ProxyLoader@users.noreply.github.com> Date: Sat, 21 Feb 2026 11:21:16 +0200 Subject: [PATCH] Refactor X-Forwarded-Host value extraction --- lib/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/request.js b/lib/request.js index e7a451df6d9..d626423a2eb 100644 --- a/lib/request.js +++ b/lib/request.js @@ -424,7 +424,7 @@ defineGetter(req, 'host', function host(){ } else if (val.indexOf(',') !== -1) { // Note: X-Forwarded-Host is normally only ever a // single value, but this is to be safe. - val = val.substring(0, val.indexOf(',')).trimRight() + val = val.split(',', 1)[0].trimEnd(); } return val || undefined;