File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1532,7 +1532,7 @@ function parseHeader(stream, callback) {
15321532 let chunk;
15331533 while (null !== (chunk = stream .read ())) {
15341534 const str = decoder .write (chunk);
1535- if (str .match ( / \n\n / )) {
1535+ if (str .includes ( ' \n\n ' )) {
15361536 // Found the header boundary.
15371537 const split = str .split (/ \n\n / );
15381538 header += split .shift ();
@@ -1545,10 +1545,10 @@ function parseHeader(stream, callback) {
15451545 stream .unshift (buf);
15461546 // Now the body of the message can be read from the stream.
15471547 callback (null , header, stream);
1548- } else {
1549- // Still reading the header.
1550- header += str;
1548+ return ;
15511549 }
1550+ // Still reading the header.
1551+ header += str;
15521552 }
15531553 }
15541554}
You can’t perform that action at this time.
0 commit comments