diff --git a/lib/node-static.js b/lib/node-static.js index 222dc7e..84f3330 100644 --- a/lib/node-static.js +++ b/lib/node-static.js @@ -180,7 +180,7 @@ Server.prototype.serve = function (req, res, callback) { } process.nextTick(function () { - that.servePath(pathname, 200, {}, req, res, finish).on('success', function (result) { + that.servePath(pathname, 200, res._headers, req, res, finish).on('success', function (result) { promise.emit('success', result); }).on('error', function (err) { promise.emit('error'); @@ -344,7 +344,7 @@ Server.prototype.respondNoGzip = function (pathname, status, contentType, _heade }; Server.prototype.respond = function (pathname, status, _headers, files, stat, req, res, finish) { - var contentType = _headers['Content-Type'] || + var contentType = res.getHeader('Content-Type') || mime.lookup(files[0]) || 'application/octet-stream';