stomp / stomp-spec

STOMP Protocol Specification
http://stomp.github.io/
78 stars 30 forks source link

Clarification of whitespace in header values #22

Closed chirino closed 13 years ago

chirino commented 13 years ago

On Fri, Oct 29, 2010 at 4:21 AM, Tim Fox tim.fox@jboss.com wrote:

Another observation that came up when implementing the STOMP 1.0 spec.

1.0 specifies that headers take the format

:.

However in practice it seems some implementations expect that

: should be interpreted by the server the same as
:. I.e. all leading whitespace (and trailing?) should be trimmed from the header value (and header name?) Initially we didn't trim in HornetQ, but now do in order to be compatible with other STOMP implementations (e.g. ActiveMQ) which do trim. Again, would be nice if the details on whitespace in headers could be firmed up in the 1.1 spec. We should bear in mind that trimming whitespace in header values could cause problems if users actually want to pass a header value that does have leading whitespace.
iande commented 13 years ago

I'm in favor of leaving whitespace alone in future versions of the STOMP spec, but to maintain backwards compatibility in the 1.1 spec, perhaps we should save this change for 2.0?

chirino commented 13 years ago

I don't agree. I think this needs to get clarified since there is ambiguity in the 1.0 specification. With the way that 1.1 does protocol negotiation, it's easy to tell if your talking to a 1.1 client/server or a 1.0 version, so client and server can easily implement backward compatible trimming of headers if need.

chirino commented 13 years ago

fixed in commit https://github.com/stomp/stomp-spec/commit/82b6841e316b48c08a6d61d15564324201d7ed0d