Skip to content

Commit 170668d

Browse files
committed
Fix streaming body with keep-alive
The body would get discarded and state would be stuck on `REQUEST_LINE` prior to this change.
1 parent 9e5daea commit 170668d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ HTTPParser.prototype.REQUEST_LINE = function () {
246246
this.info.url = match[2];
247247
this.info.versionMajor = +match[3];
248248
this.info.versionMinor = +match[4];
249-
this.body_bytes = 0;
250249
this.state = 'HEADER';
251250
};
252251

@@ -353,6 +352,7 @@ HTTPParser.prototype.HEADER = function () {
353352
}
354353

355354
info.shouldKeepAlive = this.shouldKeepAlive();
355+
356356
//problem which also exists in original node: we should know skipBody before calling onHeadersComplete
357357
var skipBody;
358358
if (compatMode0_12) {

0 commit comments

Comments
 (0)