edgeport - v1.0.3
    Preparing search index...

    Function escapeHeader

    • Escapes a STOMP 1.2 header key or value for the wire.

      Encodes the four reserved characters so a header line stays unambiguous: backslash, carriage return, line feed, and colon. Bodies are never escaped; only header octets pass through here.

      Parameters

      • s: string

        The raw header key or value.

      Returns string

      The escaped string safe to place in a key:value line.

      1.0.0

      import { escapeHeader } from 'edgeport/stomp';

      escapeHeader('a:b\nc'); // 'a\\cb\\nc'