1
0
Fork 0
forked from svrjs/svrjs

Use template strings for user agent information log messages

This commit is contained in:
Dorian Niemiec 2024-08-27 17:43:31 +02:00
parent fc14cfcc1b
commit f247e7a035
3 changed files with 3 additions and 3 deletions

View file

@ -49,7 +49,7 @@ function noproxyHandler(req, socket, head) {
} wants to proxy ${req.url} through this server`, } wants to proxy ${req.url} through this server`,
); );
if (req.headers["user-agent"] != undefined) 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."); logFacilities.errmessage("This server will never be a proxy.");
if (!socket.destroyed) socket.end("HTTP/1.1 501 Not Implemented\n\n"); if (!socket.destroyed) socket.end("HTTP/1.1 501 Not Implemented\n\n");

View file

@ -54,7 +54,7 @@ function proxyHandler(req, socket, head) {
} wants to proxy ${req.url} through this server`, } wants to proxy ${req.url} through this server`,
); );
if (req.headers["user-agent"] != undefined) 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; let index = 0;

View file

@ -287,7 +287,7 @@ function requestHandler(req, res) {
}${req.headers.host == undefined || req.isProxy ? "" : req.headers.host}${req.url}`, }${req.headers.host == undefined || req.isProxy ? "" : req.headers.host}${req.url}`,
); );
if (req.headers["user-agent"] != undefined) 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) if (oldHostHeader && oldHostHeader != req.headers.host)
logFacilities.resmessage( logFacilities.resmessage(
"Host name rewritten: " + oldHostHeader + " => " + req.headers.host, "Host name rewritten: " + oldHostHeader + " => " + req.headers.host,