diff --git a/lib/transport/receiver/xhr.js b/lib/transport/receiver/xhr.js index 8ec7bc84..f662c96f 100644 --- a/lib/transport/receiver/xhr.js +++ b/lib/transport/receiver/xhr.js @@ -37,12 +37,13 @@ XhrReceiver.prototype._chunkHandler = function(status, text) { return; } - for (var idx = -1; ; this.bufferPosition += idx + 1) { + for (var idx = -1; ; ) { var buf = text.slice(this.bufferPosition); idx = buf.indexOf('\n'); if (idx === -1) { break; } + this.bufferPosition += idx + 1; var msg = buf.slice(0, idx); if (msg) { debug('message', msg);