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) {
1532
1532
let chunk;
1533
1533
while (null !== (chunk = stream .read ())) {
1534
1534
const str = decoder .write (chunk);
1535
- if (str .match ( / \n\n / )) {
1535
+ if (str .includes ( ' \n\n ' )) {
1536
1536
// Found the header boundary.
1537
1537
const split = str .split (/ \n\n / );
1538
1538
header += split .shift ();
@@ -1545,10 +1545,10 @@ function parseHeader(stream, callback) {
1545
1545
stream .unshift (buf);
1546
1546
// Now the body of the message can be read from the stream.
1547
1547
callback (null , header, stream);
1548
- } else {
1549
- // Still reading the header.
1550
- header += str;
1548
+ return ;
1551
1549
}
1550
+ // Still reading the header.
1551
+ header += str;
1552
1552
}
1553
1553
}
1554
1554
}
You can’t perform that action at this time.
0 commit comments