From 88e923ffbc82dd0ea9c5a9d39315bf31dac405f1 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Fri, 2 Feb 2024 19:23:45 +0100 Subject: [PATCH] Fixed SVR.JS crashes with X-SVR-JS-From-Main-Thread header and unspecified client request IPs --- svr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svr.js b/svr.js index e0b1c1e..206b24c 100644 --- a/svr.js +++ b/svr.js @@ -2953,7 +2953,7 @@ if (!cluster.isPrimary) { } } - if (req.headers["x-svr-js-from-main-thread"] == "true" && (!req.socket.remoteAddress || req.socket.remoteAddress == "::1" || req.socket.remoteAddress == "::ffff:127.0.0.1" || req.socket.remoteAddress == "127.0.0.1" || req.socket.remoteAddress == "localhost" || req.socket.remoteAddress == host || req.socket.remoteAddress == "::ffff:" + host)) { + if (req.headers["x-svr-js-from-main-thread"] == "true" && req.socket && (!req.socket.remoteAddress || req.socket.remoteAddress == "::1" || req.socket.remoteAddress == "::ffff:127.0.0.1" || req.socket.remoteAddress == "127.0.0.1" || req.socket.remoteAddress == "localhost" || req.socket.remoteAddress == host || req.socket.remoteAddress == "::ffff:" + host)) { var headers = getCustomHeaders(); res.writeHead(204, "No Content", headers); res.end();