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 @@ -1586,7 +1586,7 @@ function parseHeader(stream, callback) {
1586
1586
let chunk;
1587
1587
while (null !== (chunk = stream .read ())) {
1588
1588
const str = decoder .write (chunk);
1589
- if (str .match ( / \n\n / )) {
1589
+ if (str .includes ( ' \n\n ' )) {
1590
1590
// Found the header boundary.
1591
1591
const split = str .split (/ \n\n / );
1592
1592
header += split .shift ();
@@ -1599,10 +1599,10 @@ function parseHeader(stream, callback) {
1599
1599
stream .unshift (buf);
1600
1600
// Now the body of the message can be read from the stream.
1601
1601
callback (null , header, stream);
1602
- } else {
1603
- // Still reading the header.
1604
- header += str;
1602
+ return ;
1605
1603
}
1604
+ // Still reading the header.
1605
+ header += str;
1606
1606
}
1607
1607
}
1608
1608
}
You can’t perform that action at this time.
0 commit comments