Permalink
Browse files

Adding more tests

  • Loading branch information...
tomgco committed Jun 20, 2012
1 parent a708d94 commit 1c815ec57044190e5d08f63702f993caf6d274d6
Showing with 20 additions and 1 deletion.
  1. +20 −1 test/staticGzipTest.js
View
@@ -157,6 +157,16 @@ module.exports = {
}
);
},
+ 'Normal traversal should work': function() {
+ assert.response(getApp(),
+ {
+ url: '/nom/../tomg.co.png'
+ },
+ function(res) {
+ res.statusCode.should.equal(200);
+ }
+ );
+ },
'Ensuring that when viewing a directory a redirect works correctly': function() {
assert.response(getApp(),
{
@@ -193,7 +203,16 @@ module.exports = {
url: '/../prefexTest.js'
},
function(res) {
- console.log(res.error);
+ res.statusCode.should.equal(403);
+ }
+ );
+ },
+ 'Ensuring you cannot traverse up the directory tree (urlencoded)': function() {
+ assert.response(getApp(),
+ {
+ url: '/%2e%2e/prefexTest.js'
+ },
+ function(res) {
res.statusCode.should.equal(403);
}
);

0 comments on commit 1c815ec

Please sign in to comment.