Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix pipelined requests with content-length header.

When a request includes a Content-length header, it does not include a
terminating CRLF after the content - the next request begins immediately.
This change prevents us from misparsing the next request.
  • Loading branch information...
commit e65957e155140cc2d9aef61dff84e1254efc93db 1 parent 63afee9
@sethml sethml authored
Showing with 3 additions and 3 deletions.
  1. +2 −1  lib/modes.js
  2. +1 −2  test/keep_alive_post.js
View
3  lib/modes.js
@@ -357,7 +357,8 @@ exports.readLen = function (buf, start, len) {
if (this._pendingBytes === 0) {
this.request.emit('end');
- this.mode = 'lastCRLF';
+ req.emit('rawEnd');
+ this.mode = this._shouldKeepAlive ? 'begin' : 'finished';
}
return start + slice.length;
View
3  test/keep_alive_post.js
@@ -73,8 +73,7 @@ test('keep-alive post', function (t) {
'Host: second.beep',
'Content-Length: 10',
'',
- '0123456789',
- 'POST /third HTTP/1.1',
+ '0123456789POST /third HTTP/1.1',
'Host: third.beep',
'Transfer-Encoding: chunked',
'',
Please sign in to comment.
Something went wrong with that request. Please try again.