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