Skip to content

Commit

Permalink
malformed URI adjustment for 404 with test case
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Feb 1, 2013
1 parent efcf0eb commit e4cb3ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/node-static.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ exports.Server.prototype.serve = function (req, res, callback) {
pathname = decodeURI(url.parse(req.url).pathname);
}
catch(e) {
return promise.emit('error', e);
pathname = url.parse(req.url).pathname;
}

var finish = function (status, headers) {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/node-static-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ suite.addBatch({
'requesting a malformed URI': {
topic: function(){
request.get(TEST_SERVER + '/a%AFc', this.callback);
}
},
'should respond with 404': function(error, response, body){
assert.equal(response.statusCode, 404);
}
Expand Down

0 comments on commit e4cb3ae

Please sign in to comment.