Stricter ws.publish type checks
This commit is contained in:
parent
cee33dc003
commit
efc5a4ee72
1 changed files with 7 additions and 0 deletions
|
@ -75,7 +75,14 @@ struct WebSocketWrapper {
|
|||
auto *ws = getWebSocket<SSL>(args);
|
||||
if (ws) {
|
||||
NativeString topic(isolate, args[0]);
|
||||
if (topic.isInvalid(args)) {
|
||||
return;
|
||||
}
|
||||
NativeString message(isolate, args[1]);
|
||||
if (message.isInvalid(args)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ws->publish(topic.getString(), message.getString(), BooleanValue(isolate, args[2]) ? uWS::OpCode::BINARY : uWS::OpCode::TEXT, BooleanValue(isolate, args[3]));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue