decode channel names on the server
This commit is contained in:
parent
38f3284307
commit
5414a92561
@ -82,7 +82,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
let messagestr = JSON.stringify(message)
|
let messagestr = JSON.stringify(message)
|
||||||
server.wss.clients.forEach(function(ws) {
|
server.wss.clients.forEach(function(ws) {
|
||||||
if(ws.channel == req.body.receiver) {
|
if(ws.channel == decodeURIComponent(req.body.receiver)) {
|
||||||
ws.send(messagestr)
|
ws.send(messagestr)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1063,7 +1063,7 @@ wss.on("connection", function connection(ws) {
|
|||||||
ws.on("message", function incoming(message) {
|
ws.on("message", function incoming(message) {
|
||||||
message = JSON.parse(message)
|
message = JSON.parse(message)
|
||||||
if(message.id == "switchChannel") {
|
if(message.id == "switchChannel") {
|
||||||
ws.channel = message.data
|
ws.channel = decodeURIComponent(message.data)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user