rest-vir - v2.3.5
    Preparing search index...

    Function sanitizeMessageForLog

    • Neutralize an attacker-supplied WebSocket message before embedding it in a log line: JSON.stringify escapes CR/LF, ANSI escape sequences, and every other control character (so a frame cannot forge log entries or corrupt terminal output), and truncation keeps a multi-megabyte frame from bloating the log. Mirrors the CR/LF-avoidance rationale in handle-route.ts. Exported for direct unit testing.

      Parameters

      • rawMessage: string

      Returns string