-
Notifications
You must be signed in to change notification settings - Fork 72k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolve npm audit security fixes (#3721)
* upgrade mocha from 3.5.3 to 5.0.5 This resolves these security issues Low Regular Expression Denial of Service Package debug Dependency of mocha [dev] Path mocha > debug More info https://nodesecurity.io/advisories/534 Critical Command Injection Package growl Dependency of mocha [dev] Path mocha > growl More info https://nodesecurity.io/advisories/146 * upgrade mocha and start modularizing lodash to make sure tests pass * more lodash modularization * upgrade mqtt to 2.18.3 * allow npm 6.2 * upgrade share2nightscout-bridge * incorporate express-extension-to-accept into Nightscout the packages seems not maintained (github page is 404) and has a security issue with mime package. so upgraded and included into Nightscout code. if somebody knows a more efficient way of programming this with express4 please PR * update jsdom for security fixes * prevent wrapping of hour labels by removing the space * Revert "update jsdom for security fixes" This reverts commit 04f1f39. * Revert "more lodash modularization" This reverts commit c4fa530. * remove forever dependency * Revert "Revert "more lodash modularization"" This reverts commit b13c274. * fix report.test.js with newer packages sometimes a fix is very easy. This is to prevent: ``` Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info. Arguments: [0] _isAMomentObject: true, _isUTC: true, _useUTC: true, _l: undefined, _i: T00:00:00, _f: undefined, _strict: undefined, _locale: [object Object] Error at Function.createFromInputFallback (XXX\cgm-remote-monitor\tmp\js\bundle.js:117408:98) at configFromString (XXX\cgm-remote-monitor\tmp\js\bundle.js:119456:15) ``` We must use ISO8601 formatted strings and not use slashes in dates, see moment/moment#1407 (comment) * upgrade webpack to 4.16.2 * Update package.json
- Loading branch information
Showing
18 changed files
with
2,813 additions
and
2,670 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
web: ./node_modules/.bin/forever --minUptime 100 -c node server.js | ||
web: node server.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
var mime = require('mime') | ||
var url = require('url') | ||
|
||
module.exports = function (formats) { | ||
if (!Array.isArray(formats)) | ||
throw new TypeError('Formats must be an array.') | ||
|
||
var getType = Object.create(null) | ||
|
||
formats.forEach(function (format) { | ||
if (!/^\w+$/.test(format)) | ||
throw new TypeError('Invalid format - must be a word.') | ||
|
||
var type = getType[format] = mime.getType(format) | ||
if (!type || type === 'application/octet-stream') | ||
throw new Error('Invalid format.') | ||
}) | ||
|
||
var regexp = new RegExp('\.(' + formats.join('|') + ')$', 'i') | ||
|
||
return function (req, res, next) { | ||
var match = req.path.match(regexp) | ||
if (!match) | ||
return next() | ||
var type = getType[match[1]] | ||
if (!type) | ||
return next() | ||
|
||
req.extToAccept = { | ||
url: req.url, | ||
accept: req.headers.accept | ||
} | ||
|
||
req.headers.accept = type | ||
var parsed = url.parse(req.url) | ||
parsed.pathname = req.path.replace(regexp, '') | ||
req.url = url.format(parsed) | ||
|
||
next() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.