Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-3501

Stomp v1.1 support, headers, eg: message-id, are not properly escaped

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      headers need to be escaped, see: http://stomp.github.com/stomp-specification-1.1.html#Value_Encoding

      but the message-id header on a message receipt is not, the perl stomp v 1.1 client does a check:

      # STOMP 1.1 behavior:
                  #  - header names and values can contain any OCTET except \n or :
                  #  - space is significant in the header
                  #  - "only the first header entry should be used"
                  #  - handle backslash escaping
                  foreach $line (split(/\n/, $temp)) {
                      unless ($line =~ /^([^:]+):([^:]*)$/o) {
                          Net::STOMP::Client::Error::report("%s: invalid header: %s", $me, $line);
                          return();
      

      and errors out on the un-escaped ':'in the raw message-id. This was not a requirement in STOMP v1.0.

      *** Net::STOMP::Client::Frame::decode(): invalid header: message-id:ID:gtmbp.local-52988-1316088964662-2:7:-1:1:1
       at /opt/local/lib/perl5/site_perl/5.8.9/Net/STOMP/Client/Error.pm line 39
      	Net::STOMP::Client::Error::report('%s: invalid header: %s', 'Net::STOMP::Client::Frame::decode()', 'message-id:ID:gtmbp.local-52988-1316088964662-2:7:-1:1:1') called at /opt/local/lib/perl5/site_perl/5.8.9/Net/STOMP/Client/Frame.pm line 286
      	Net::STOMP::Client::Frame::decode('SCALAR(0x987818)', 'version', 1.1, 'state', 'HASH(0x988184)') called at /opt/local/lib/perl5/site_perl/5.8.9/Net/STOMP/Client.pm line 472
      	Net::STOMP::Client::receive_frame('Net::STOMP::Client=HASH(0x988040)', 1) called at /opt/local/lib/perl5/site_perl/5.8.9/Net/STOMP/Client.pm line 502

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            gtully Gary Tully
            gtully Gary Tully
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment