if (options.schema) {
if (typeof message === 'string') {
if (message.indexOf('[') === 0 || message.indexOf('{') === 0) {
if (message.indexOf('[object') === -1) {
message = JSON.parse(message);
}
}
}
The code will attempt to JSON.parse() a string like {keyWithoutQuotes:stringValueWithoutQuotes} which is an invalid JSON object causing JSON.parse() to throw
The bug is located in /src/handler/ws.js
The code fragment that causes the issue is this:
The code will attempt to JSON.parse() a string like
{keyWithoutQuotes:stringValueWithoutQuotes}
which is an invalid JSON object causing JSON.parse() to throw