Skip to content

Commit

Permalink
tests: add a test for a short request
Browse files Browse the repository at this point in the history
this PROXY line is valid except it is short and lacks a \n sequence so
we shouldn't return or do anything.
  • Loading branch information
Brandon Philips committed Oct 8, 2012
1 parent 1deb1c8 commit 7f0a771
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/tcp4-no-newline.txt
@@ -0,0 +1 @@
PROXY TCP4 127.0.0.1 127.0.0.1 65533 65533
5 changes: 5 additions & 0 deletions test.js
Expand Up @@ -43,3 +43,8 @@ proxy_protocol.parse(garbage, function(err, obj) {
console.log("Error on garbage");
}
});

var newline = fs.createReadStream("examples/tcp4-no-newline.txt")
proxy_protocol.parse(newline, function(err, obj) {
console.log('ERROR: We should not be here this test is for a short stream');
});

0 comments on commit 7f0a771

Please sign in to comment.