Skip to content

Commit 64151eb

Browse files
committed
Add test to demonstrate Denial of Service issue
- https://www.npmjs.com/advisories/1208 - cloudhead#213
1 parent 89af84a commit 64151eb

File tree

2 files changed

+1203
-0
lines changed

2 files changed

+1203
-0
lines changed

test/integration/node-static-test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,22 @@ suite.addBatch({
9595
}
9696
}
9797
})
98+
.addBatch({
99+
'requesting a forbidden URI /%00': {
100+
topic : function(){
101+
request.get(TEST_SERVER + '/%00', this.callback);
102+
},
103+
'should respond with 403' : function(error, response, body){
104+
assert.equal(response.statusCode, 403);
105+
},
106+
'should respond without content-type header': function(error, response, body){
107+
assert.isUndefined(response.headers['content-type']);
108+
},
109+
'should respond with empty body': function(error, response, body){
110+
assert.isEmpty(body);
111+
}
112+
}
113+
})
98114
.addBatch({
99115
'serving empty.css': {
100116
topic : function(){

0 commit comments

Comments
 (0)