1
0
Fork 0
forked from svrjs/svrjs

Replace ES5-style functions in code for sending data to a statistics server with ES6-style functions

This commit is contained in:
Dorian Niemiec 2024-08-26 10:03:51 +02:00
parent f403053c44
commit 686ec4924e

View file

@ -1008,13 +1008,13 @@ function listeningMessage() {
"Content-Length": Buffer.byteLength(statisticsToSend),
},
},
function (res) {
(res) => {
const statusCode = res.statusCode;
let data = "";
res.on("data", function (chunk) {
res.on("data", (chunk) => {
data += chunk.toString();
});
res.on("end", function () {
res.on("end", () => {
try {
let parsedJson = {};
try {
@ -1036,7 +1036,7 @@ function listeningMessage() {
});
},
);
statisticsRequest.on("error", function (err) {
statisticsRequest.on("error", (err) => {
serverconsole.locwarnmessage(
"There was a problem, when sending data to statistics server! Reason: " +
err.message,