easternbloc / node-stomp-client

A STOMP client for Node.js
Other
93 stars 47 forks source link

parse message-id error #13

Open amwicfai opened 11 years ago

amwicfai commented 11 years ago

the message-id include ":", example: xxxxxxxxx04-37571-1369787148937-2:209:-1:1:3

so split it by ":" is error.

var kv = line.split(':', 2); //from parser.js

easternbloc commented 11 years ago

Pretty sure headers need encoding see:

http://stomp.github.io/stomp-specification-1.1.html#Value_Encoding

easternbloc commented 11 years ago

Are you using ActiveMQ?

If so what version?

amwicfai commented 11 years ago

I can reproduce the problem on ActiveMQ 5.8, please verify.

easternbloc commented 11 years ago

Strange, it appears to have been fixed in 5.6

https://issues.apache.org/jira/browse/AMQ-3501

sam-github commented 11 years ago

I haven't attempted to verify this, but it sounds like a bug. Note that stomp-client makes STOMP 1.0 connections, not 1.1 (the accept-version: header is missing, see http://stomp.github.io/stomp-specification-1.1.html#protocol_negotiation), and header values can contain any character other than NL in 1.0. The first : is the name/value seperator:

header              = header-name ":" header-value
header-name         = 1*<any CHAR except LF or ":">
header-value        = 1*<any CHAR except LF>