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

Stomp 1.2 value encoding is not implemented #1534

Closed
michaelJustin opened this issue Jul 23, 2022 · 0 comments · Fixed by #1545
Closed

Stomp 1.2 value encoding is not implemented #1534

michaelJustin opened this issue Jul 23, 2022 · 0 comments · Fixed by #1545
Labels
bug Something isn't working stomp
Milestone

Comments

@michaelJustin
Copy link
Contributor

https://stomp.github.io/stomp-specification-1.2.html#Value_Encoding

The commands and headers are encoded in UTF-8. All frames except the CONNECT and CONNECTED frames will also escape any carriage return, line feed or colon found in the resulting UTF-8 encoded headers.

Escaping is needed to allow header keys and values to contain those frame header delimiting octets as values. The CONNECT and CONNECTED frames do not escape the carriage return, line feed or colon octets in order to remain backward compatible with STOMP 1.0.

C style string literal escapes are used to encode any carriage return, line feed or colon that are found within the UTF-8 encoded headers. When decoding frame headers, the following transformations MUST be applied:

    \r (octet 92 and 114) translates to carriage return (octet 13)
    \n (octet 92 and 110) translates to line feed (octet 10)
    \c (octet 92 and 99) translates to : (octet 58)
    \\ (octet 92 and 92) translates to \ (octet 92)

Undefined escape sequences such as \t (octet 92 and 116) MUST be treated as a fatal protocol error. Conversely when encoding frame headers, the reverse transformation MUST be applied.

The STOMP 1.0 specification included many example frames with padding in the headers and many servers and clients were implemented to trim or pad header values. This causes problems if applications want to send headers that SHOULD not get trimmed. In STOMP 1.2, clients and servers MUST never trim or pad headers with spaces.

OpenMQ does not apply the transformations for carriage return, line feed or colon octets and for the backslash character.

Proposal:
With this issue the implementation of the transformations will be addressed. Other parts of this specification section will be implemented with subsequent issues.

Other notes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stomp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants