Skip to content

Workaround - React Native STOMP issue because NULL chopping #55

@omars94

Description

@omars94

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;
       }
   };

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions