fix major bug

Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
Yonle 2023-11-02 22:06:12 +07:00
parent 4ca71948c3
commit 4699ba1b48
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ module.exports = (ws, req) => {
pendingEOSE.add(data[1]);
break;
case "CLOSE":
if (typeof(data[1]) !== "string") ws.send(JSON.stringify(["NOTICE", "error: bad request."]));
if (typeof(data[1]) !== "string") return ws.send(JSON.stringify(["NOTICE", "error: bad request."]));
data[1] = ws.id + ":" + data[1];
bc(data);
pendingEOSE.delete(data[1]);

View File

@ -43,7 +43,7 @@ module.exports = (ws, req) => {
pendingEOSE.add(ws.id + ":" + data[1]);
break;
case "CLOSE":
if (typeof(data[1]) !== "string") ws.send(JSON.stringify(["NOTICE", "error: bad request."]));
if (typeof(data[1]) !== "string") return ws.send(JSON.stringify(["NOTICE", "error: bad request."]));
bc(data, ws.id);
pendingEOSE.delete(ws.id + ":" + data[1]);
sess.prepare("DELETE FROM sess WHERE cID = ? AND subID = ?;").run(ws.id, data[1]);