Stricter ws.publish type checks
This commit is contained in:
parent
cee33dc003
commit
efc5a4ee72
@ -75,7 +75,14 @@ struct WebSocketWrapper {
|
|||||||
auto *ws = getWebSocket<SSL>(args);
|
auto *ws = getWebSocket<SSL>(args);
|
||||||
if (ws) {
|
if (ws) {
|
||||||
NativeString topic(isolate, args[0]);
|
NativeString topic(isolate, args[0]);
|
||||||
|
if (topic.isInvalid(args)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
NativeString message(isolate, args[1]);
|
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]));
|
ws->publish(topic.getString(), message.getString(), BooleanValue(isolate, args[2]) ? uWS::OpCode::BINARY : uWS::OpCode::TEXT, BooleanValue(isolate, args[3]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user