I was facing an issue where the stomp client doesn't get connected to server because of the null terminator and the connect message wasn't parsed at server side correctly because it was sent as string instead of binary array.
I did lots of debugging on it and the solution was to make isBinaryBody always true
like so
FrameImpl.prototype.serialize = function () {
var cmdAndHeaders = this.serializeCmdAndHeaders();
if (this.isBinaryBody || true) { // to always return as binary array
return FrameImpl.toUnit8Array(cmdAndHeaders, this._binaryBody).buffer;
}
else {
return cmdAndHeaders + this._body + byte_1.BYTE.NULL;
}
};