From f4f7a24af047fc77a7f6e4ba7ab00ee95e07e2d8 Mon Sep 17 00:00:00 2001 From: Kai Gohegan Date: Sat, 17 Aug 2013 16:55:24 +0100 Subject: [PATCH] Minor change the the parse_headers function --- lib/stomp.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/stomp.js b/lib/stomp.js index bb51546..48734b2 100644 --- a/lib/stomp.js +++ b/lib/stomp.js @@ -50,8 +50,16 @@ function parse_headers(raw_headers) { var header_val = header.join(':').trim(); headers[header_key] = header_val; continue; - } - headers[header[0].trim()] = header[1].trim(); + } else { + /** + * This was causing errors for me, + * unsure as to why it is placed here + * in the code anyway, as we have already + * tested the length of the array + * above. + */ + headers[header[0].trim()] = null; + } } return headers; };