From f247e7a035b39cc592e18d570f71a693e7494b76 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Tue, 27 Aug 2024 17:43:31 +0200 Subject: [PATCH] Use template strings for user agent information log messages --- src/handlers/noproxyHandler.js | 2 +- src/handlers/proxyHandler.js | 2 +- src/handlers/requestHandler.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/handlers/noproxyHandler.js b/src/handlers/noproxyHandler.js index df6d892..635d9ec 100644 --- a/src/handlers/noproxyHandler.js +++ b/src/handlers/noproxyHandler.js @@ -49,7 +49,7 @@ function noproxyHandler(req, socket, head) { } wants to proxy ${req.url} through this server`, ); if (req.headers["user-agent"] != undefined) - logFacilities.reqmessage("Client uses " + req.headers["user-agent"]); + logFacilities.reqmessage(`Client uses ${req.headers["user-agent"]}`); logFacilities.errmessage("This server will never be a proxy."); if (!socket.destroyed) socket.end("HTTP/1.1 501 Not Implemented\n\n"); diff --git a/src/handlers/proxyHandler.js b/src/handlers/proxyHandler.js index 7b76684..6864fc9 100644 --- a/src/handlers/proxyHandler.js +++ b/src/handlers/proxyHandler.js @@ -54,7 +54,7 @@ function proxyHandler(req, socket, head) { } wants to proxy ${req.url} through this server`, ); if (req.headers["user-agent"] != undefined) - logFacilities.reqmessage("Client uses " + req.headers["user-agent"]); + logFacilities.reqmessage(`Client uses ${req.headers["user-agent"]}`); let index = 0; diff --git a/src/handlers/requestHandler.js b/src/handlers/requestHandler.js index 9c5f414..53ec7a1 100644 --- a/src/handlers/requestHandler.js +++ b/src/handlers/requestHandler.js @@ -287,7 +287,7 @@ function requestHandler(req, res) { }${req.headers.host == undefined || req.isProxy ? "" : req.headers.host}${req.url}`, ); if (req.headers["user-agent"] != undefined) - logFacilities.reqmessage("Client uses " + req.headers["user-agent"]); + logFacilities.reqmessage(`Client uses ${req.headers["user-agent"]}`); if (oldHostHeader && oldHostHeader != req.headers.host) logFacilities.resmessage( "Host name rewritten: " + oldHostHeader + " => " + req.headers.host,