1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
Description: fix for node-mime ≥ 2
Author: Xavier Guimard <yadd@debian.org>
Forwarded: no
Last-Update: 2020-11-01
--- a/lib/node-static.js
+++ b/lib/node-static.js
@@ -341,7 +341,7 @@
Server.prototype.respond = function (pathname, status, _headers, files, stat, req, res, finish) {
var contentType = _headers['Content-Type'] ||
- mime.lookup(files[0]) ||
+ mime.getType(files[0]) ||
'application/octet-stream';
if(this.options.gzip) {
--- a/test/integration/node-static-test.js
+++ b/test/integration/node-static-test.js
@@ -305,7 +305,7 @@
this.callback();
},
'should add woff' : function(error, response, body){
- assert.equal(static.mime.lookup('woff'), 'application/font-woff');
+ assert.equal(static.mime.getType('woff'), 'application/font-woff');
}
}
})
|