Permalink
Browse files

malformed URI adjustment for 404 with test case

  • Loading branch information...
1 parent efcf0eb commit e4cb3ae7aa9f6f9b20a9579edcff003b796030e9 @guybedford guybedford committed Feb 1, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/node-static.js
  2. +1 −1 test/integration/node-static-test.js
View
@@ -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) {
@@ -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);
}

0 comments on commit e4cb3ae

Please sign in to comment.