Comparing version 0.4.5 to 0.4.6
@@ -146,3 +146,3 @@ #! /usr/bin/env node | ||
(req.headers['if-none-match'] === etag(stat)) | ||
|| (Date.parse(req.headers['if-modified-since']) >= stat.mtime) | ||
|| (new Date(Date.parse(req.headers['if-modified-since'])) >= stat.mtime) | ||
) | ||
@@ -149,0 +149,0 @@ ) { |
@@ -5,3 +5,3 @@ { | ||
"description": "A simple static file server middleware that works with both Express and Flatiron", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"homepage": "https://github.com/jesusabdullah/node-ecstatic", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -6,8 +6,6 @@ var test = require('tap').test, | ||
var server; | ||
test('malformed uri', function (t) { | ||
t.plan(1); | ||
var server = http.createServer(ecstatic(__dirname)); | ||
t.on('end', function () { | ||
server.close(); | ||
}); | ||
server = http.createServer(ecstatic(__dirname)); | ||
@@ -22,4 +20,15 @@ server.listen(0, function () { | ||
t.equal(res.statusCode, 400); | ||
t.end(); | ||
}); | ||
}); | ||
}); | ||
test('server teardown', function (t) { | ||
server.close(); | ||
var to = setTimeout(function () { | ||
process.stderr.write('# server not closing; slaughtering process.\n'); | ||
process.exit(0); | ||
}, 5000); | ||
t.end(); | ||
}); |
224986
852