This commit is contained in:
Christopher Cookman 2024-09-04 08:05:01 -06:00
parent e0ce204118
commit 12eb3aef9b
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -54,6 +54,14 @@ app.post("/api/send/:jobid/:id/", (req, res) => {
var id = req.params.id;
var stats = ws_[id];
var socket = ws_[id].connection;
// Catch if body is not json data
if (!req.body.data) {
res.status(400).send({
success: false,
message: "No data provided"
});
return;
}
console.log("sent data: " + req.body)
if (stats.open == true) {
socket.send(req.body.data);