Skip to content

Commit

Permalink
fix parse bug with windows style newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb Welton committed Dec 3, 2023
1 parent 7723ab8 commit a0fd6dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sse.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ var SSE = function (url, options) {
var data = this.xhr.responseText.substring(this.progress);

this.progress += data.length;
var parts = (this.chunk + data).split(/(\r\n|\r|\n){2}/g);
var parts = (this.chunk + data).split(/(\r\n\r\n|\r\r|\n\n)/g);

// we assume that the last chunk can be incomplete because of buffering or other network effects
// so we always save the last part to merge it with the next incoming packet
Expand Down

0 comments on commit a0fd6dc

Please sign in to comment.