Socket
Socket
Sign inDemoInstall

mongodb-memory-server-core

Package Overview
Dependencies
12
Maintainers
2
Versions
261
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 9.1.8 to 9.2.0-beta.1

19

lib/util/MongoBinaryDownload.js

@@ -282,8 +282,23 @@ "use strict";

}
// content-length, otherwise 0
let contentLength;
if (typeof response.headers['content-length'] != 'string') {
reject(new errors_1.DownloadError(downloadUrl, 'Response header "content-length" is empty!'));
log('Response header "content-lenght" is empty!');
contentLength = 0;
}
else {
contentLength = parseInt(response.headers['content-length'], 10);
if (Number.isNaN(contentLength)) {
log('Response header "content-lenght" resolved to NaN!');
contentLength = 0;
}
}
// error if the content-length header is missing or is 0 if config option "DOWNLOAD_IGNORE_MISSING_HEADER" is not set to "true"
if (!(0, resolveConfig_1.envToBool)((0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.DOWNLOAD_IGNORE_MISSING_HEADER)) &&
contentLength <= 0) {
reject(new errors_1.DownloadError(downloadUrl, 'Response header "content-length" does not exist or resolved to NaN'));
return;
}
this.dlProgress.current = 0;
this.dlProgress.length = parseInt(response.headers['content-length'], 10);
this.dlProgress.length = contentLength;
this.dlProgress.totalMb = Math.round((this.dlProgress.length / 1048576) * 10) / 10;

@@ -290,0 +305,0 @@ const fileStream = (0, fs_1.createWriteStream)(tempDownloadLocation);

3

lib/util/resolveConfig.d.ts

@@ -10,2 +10,3 @@ /** Enum of all possible config options */

DOWNLOAD_URL = "DOWNLOAD_URL",
DOWNLOAD_IGNORE_MISSING_HEADER = "DOWNLOAD_IGNORE_MISSING_HEADER",
PREFER_GLOBAL_PATH = "PREFER_GLOBAL_PATH",

@@ -27,3 +28,3 @@ DISABLE_POSTINSTALL = "DISABLE_POSTINSTALL",

/** This Value exists here, because "defaultValues" can be changed with "setDefaultValue", but this property is constant */
export declare const DEFAULT_VERSION = "6.0.9";
export declare const DEFAULT_VERSION = "6.0.14";
/** Default values for some config options that require explicit setting, it is constant so that the default values cannot be interfered with */

@@ -30,0 +31,0 @@ export declare const defaultValues: Map<ResolveConfigVariables, string>;

@@ -22,2 +22,3 @@ "use strict";

ResolveConfigVariables["DOWNLOAD_URL"] = "DOWNLOAD_URL";
ResolveConfigVariables["DOWNLOAD_IGNORE_MISSING_HEADER"] = "DOWNLOAD_IGNORE_MISSING_HEADER";
ResolveConfigVariables["PREFER_GLOBAL_PATH"] = "PREFER_GLOBAL_PATH";

@@ -39,3 +40,3 @@ ResolveConfigVariables["DISABLE_POSTINSTALL"] = "DISABLE_POSTINSTALL";

/** This Value exists here, because "defaultValues" can be changed with "setDefaultValue", but this property is constant */
exports.DEFAULT_VERSION = '6.0.9';
exports.DEFAULT_VERSION = '6.0.14';
/** Default values for some config options that require explicit setting, it is constant so that the default values cannot be interfered with */

@@ -42,0 +43,0 @@ exports.defaultValues = new Map([

{
"name": "mongodb-memory-server-core",
"version": "9.1.8",
"version": "9.2.0-beta.1",
"description": "MongoDB Server for testing (core package, without autodownload). The server will allow you to connect your favourite ODM or client library to the MongoDB Server and run parallel integration tests isolated from each other.",

@@ -37,3 +37,3 @@ "main": "lib/index",

"@types/follow-redirects": "^1.14.4",
"@types/semver": "^7.5.5",
"@types/semver": "^7.5.8",
"@types/tar-stream": "^3.1.3",

@@ -51,9 +51,9 @@ "@types/yauzl": "^2.10.3",

"follow-redirects": "^1.15.6",
"https-proxy-agent": "^7.0.2",
"https-proxy-agent": "^7.0.4",
"mongodb": "^5.9.1",
"new-find-package-json": "^2.0.0",
"semver": "^7.5.4",
"tar-stream": "^3.0.0",
"semver": "^7.6.0",
"tar-stream": "^3.1.7",
"tslib": "^2.6.2",
"yauzl": "^2.10.0"
"yauzl": "^3.1.3"
},

@@ -60,0 +60,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc