This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add another test to test-http-parser-bad-ref.js demoing #2438

  • Loading branch information...
ry committed Jan 4, 2012
1 parent 6f8839d commit 2cde4983199473a1bf1650ef485f94b68194aa85
Showing with 10 additions and 2 deletions.
  1. +10 −2 test/simple/test-http-parser-bad-ref.js
@@ -15,6 +15,8 @@ function flushPool() {
}
function demoBug(part1, part2) {
+ flushPool();
+
var parser = new HTTPParser('REQUEST');
parser.headers = [];
@@ -56,6 +58,8 @@ function demoBug(part1, part2) {
parser.execute(b, 0, b.length);
parser.finish();
})();
+
+ flushPool();
}
@@ -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.