Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: null message crash and drop array messages #51

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Flechaa
Copy link
Contributor

@Flechaa Flechaa commented Jan 2, 2025

Previously in PR #48, all JSON releated crashes were supposed to be fixed, however I completely missed out that typeof doesn't catch things like null in JSON since they are considered an object in JavaScript.

Also arrays are not used for messages in Rotom so those were also checked and dropped in this PR.

Snippet that replicates the crash:

const WebSocket = require("ws");

const ws = new WebSocket("ws://localhost:7070/control", {
    headers: {
        "x-rotom-secret": ""
    }
});

ws.on("open", () => {
    ws.send("null");
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant