From 55367665e80ddf20864da5d7bc9dd9902e688d17 Mon Sep 17 00:00:00 2001 From: Dragory Date: Wed, 8 Aug 2018 01:10:38 +0300 Subject: [PATCH] Update mime node-mime to 2.3.1 --- package-lock.json | 6 +++--- package.json | 2 +- src/modules/webserver.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1a027d6..82d3b31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1870,9 +1870,9 @@ } }, "mime": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.6.tgz", - "integrity": "sha1-WR2E02U6awtKO5343lqoEI5y5eA=" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", + "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" }, "mime-db": { "version": "1.35.0", diff --git a/package.json b/package.json index a0cfe89..f5aaa74 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "humanize-duration": "^3.12.1", "json5": "^1.0.1", "knex": "^0.14.2", - "mime": "^1.3.4", + "mime": "^2.3.1", "moment": "^2.21.0", "public-ip": "^2.0.1", "sqlite3": "^4.0.2", diff --git a/src/modules/webserver.js b/src/modules/webserver.js index da7b63f..fdad567 100644 --- a/src/modules/webserver.js +++ b/src/modules/webserver.js @@ -61,7 +61,7 @@ function serveAttachments(res, pathParts) { const filenameParts = desiredFilename.split('.'); const ext = (filenameParts.length > 1 ? filenameParts[filenameParts.length - 1] : 'bin'); - const fileMime = mime.lookup(ext); + const fileMime = mime.getType(ext); res.setHeader('Content-Type', fileMime);