From 8672afe9409ba15160557ab39abfad9bcd8fdbcd Mon Sep 17 00:00:00 2001 From: MCRcortex Date: Wed, 17 Jul 2019 22:04:29 +1000 Subject: [PATCH] added res.sendStatus(200); to stop client errors throwing according to the docs "The methods on the response object (res) in the following table can send a response to the client, and terminate the request-response cycle. If none of these methods are called from a route handler, the client request will be left hanging." Last sentence is the critical one. Sending a status code 200 should fix the issue --- master.js | 1 + 1 file changed, 1 insertion(+) diff --git a/master.js b/master.js index 358e911f..b87b7d27 100644 --- a/master.js +++ b/master.js @@ -362,6 +362,7 @@ app.post("/api/editSlaveMeta", authenticate.middleware, function(req,res) { let metaPortion = JSON.stringify(req.body.meta); if(metaPortion.length > 50) metaPortion = metaPortion.substring(0,20) + "..."; // console.log("Updating slave "+slaves[req.body.instanceID].instanceName+": " + slaves[req.body.instanceID].mac + " : " + slaves[req.body.instanceID].serverPort+" at " + slaves[req.body.instanceID].publicIP, metaPortion); + res.sendStatus(200); } else { res.send("ERROR: Invalid instanceID or password") }