diff options
author | Minteck <nekostarfan@gmail.com> | 2021-05-05 13:00:23 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-05-05 13:00:23 +0200 |
commit | 971783dafcb441de323bd282c375830c852a5c75 (patch) | |
tree | 0c78b6719c554516b91c2acd7cea5b2c4b458e1d /index.js | |
parent | f72770f62a1bde2b92d83561853f8996a48fd0e3 (diff) | |
download | kartik-legacy-server-971783dafcb441de323bd282c375830c852a5c75.tar.gz kartik-legacy-server-971783dafcb441de323bd282c375830c852a5c75.tar.bz2 kartik-legacy-server-971783dafcb441de323bd282c375830c852a5c75.zip |
Commit
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -269,7 +269,7 @@ server.on('connection', (socket) => { ) + "\n") break; case "link": - if (typeof info['client'] !== "string" || isNaN(parseInt(info['client'], 16))) { + if (typeof info['client'] !== "string" || isNaN(parseInt(info['client'], 36))) { throw new KartikError("Invalid client link ID", "net.minteckprojects.kartik.KartikServer.GuestIdentifierException"); } if (typeof clients[info['client']] === "undefined") { @@ -309,7 +309,7 @@ server.on('connection', (socket) => { if (socket.linkedTo === null) { throw new KartikError("Client not linked to another client", "net.minteckprojects.kartik.KartikServer.DataRoutingException"); } else { - socket.linkedTo.write(JSON.stringify(info) + "\n"); + socket.linkedTo.write(JSON.stringify(info).replaceAll("<", "-").replaceAll(">", "-") + "\n"); } } } @@ -321,8 +321,8 @@ server.on('connection', (socket) => { } socket.write(JSON.stringify({ _type: "error", - message: e.message, - type: e.ktype + message: e.message.replaceAll("<", "-").replaceAll(">", "-"), + type: e.ktype.replaceAll("<", "-").replaceAll(">", "-") }) + "\n") socket.end(); } |