benjaminws/stomp-js — Issue #14: body loses data
Author: jmls
Created: 2011-10-27 11:10:47+00:00
State: open

I think that there is a bug in parse_frame(), as this line of code

the_rest = data.split('\n\n');

splits the body from the header.

body = the_rest[1];

However, if the body itself contains data with "\n\n" embedded (for example, a "readme" file) then only the first chunk of the body is saved - as the_rest[2 .. n] contains the "rest" of the body

Should you not grab the headers from the start to the index of the *first* \n\n ?