C style string literal escapes are used to encode any colons and newlines that are found within the UTF-8 encoded headers. When decoding frame headers, the following transformations MUST be applied:
\n (octet 92 and 110) translates to newline (octet 10)
\c (octet 92 and 99) translates to : (octet 58)
\\ (octet 92 and 92) translates to \ (octet 92)
Currently, webstomp-client (as well as jmesnil's stomp-websocket) does not escape \ into \\:
Object.keys(this.headers).forEach(name => {
let value = this.headers[name];
lines.push(`${name}:${value}`);
});
What are your thoughts on this? Shouldn't this be implemented in the library, since it's something defined in the specification, and should therefore not a responsability of the client application?
I have a use case where I need to send a backslash in a header of a SUBSCRIBE frame.
The STOMP specification states that:
Currently, webstomp-client (as well as jmesnil's stomp-websocket) does not escape
\
into\\
:What are your thoughts on this? Shouldn't this be implemented in the library, since it's something defined in the specification, and should therefore not a responsability of the client application?
Thanks.