Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Add another test to test-http-parser-bad-ref.js demoing #2438
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Jan 4, 2012
1 parent 6f8839d commit 2cde498
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/simple/test-http-parser-bad-ref.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ function flushPool() {
}

function demoBug(part1, part2) {
flushPool();

var parser = new HTTPParser('REQUEST');

parser.headers = [];
Expand Down Expand Up @@ -56,6 +58,8 @@ function demoBug(part1, part2) {
parser.execute(b, 0, b.length);
parser.finish();
})();

flushPool();
}


Expand All @@ -64,9 +68,13 @@ demoBug('POST /1', '/22 HTTP/1.1\r\n' +
'Content-Length: 4\r\n\r\n' +
'pong');

demoBug('POST /1/22 HTTP/1.1\r\n' +
'Content-Type: tex', 't/plain\r\n' +
'Content-Length: 4\r\n\r\n' +
'pong');

process.on('exit', function() {
assert.equal(1, headersComplete);
assert.equal(1, messagesComplete);
assert.equal(2, headersComplete);
assert.equal(2, messagesComplete);
console.log("done!");
});

0 comments on commit 2cde498

Please sign in to comment.