Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

mongodb

Package Overview
Dependencies
Maintainers
8
Versions
562
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb - npm Package Compare versions

Comparing version 6.4.0-dev.20240301.sha.f2b3484 to 6.4.0-dev.20240305.sha.eab8f23

12

lib/connection_string.js

@@ -39,4 +39,10 @@ "use strict";

}
// Asynchronously start TXT resolution so that we do not have to wait until
// the SRV record is resolved before starting a second DNS query.
const lookupAddress = options.srvHost;
const txtResolutionPromise = dns.promises.resolveTxt(lookupAddress);
txtResolutionPromise.catch(() => {
/* rejections will be handled later */
});
// Resolve the SRV record and use the result as the list of hosts to connect to.
const lookupAddress = options.srvHost;
const addresses = await dns.promises.resolveSrv(`_${options.srvServiceName}._tcp.${lookupAddress}`);

@@ -53,6 +59,6 @@ if (addresses.length === 0) {

validateLoadBalancedOptions(hostAddresses, options, true);
// Resolve TXT record and add options from there if they exist.
// Use the result of resolving the TXT record and add options from there if they exist.
let record;
try {
record = await dns.promises.resolveTxt(lookupAddress);
record = await txtResolutionPromise;
}

@@ -59,0 +65,0 @@ catch (error) {

{
"name": "mongodb",
"version": "6.4.0-dev.20240301.sha.f2b3484",
"version": "6.4.0-dev.20240305.sha.eab8f23",
"description": "The official MongoDB driver for Node.js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -71,4 +71,11 @@ import * as dns from 'dns';

// Asynchronously start TXT resolution so that we do not have to wait until
// the SRV record is resolved before starting a second DNS query.
const lookupAddress = options.srvHost;
const txtResolutionPromise = dns.promises.resolveTxt(lookupAddress);
txtResolutionPromise.catch(() => {
/* rejections will be handled later */
});
// Resolve the SRV record and use the result as the list of hosts to connect to.
const lookupAddress = options.srvHost;
const addresses = await dns.promises.resolveSrv(

@@ -92,6 +99,6 @@ `_${options.srvServiceName}._tcp.${lookupAddress}`

// Resolve TXT record and add options from there if they exist.
// Use the result of resolving the TXT record and add options from there if they exist.
let record;
try {
record = await dns.promises.resolveTxt(lookupAddress);
record = await txtResolutionPromise;
} catch (error) {

@@ -98,0 +105,0 @@ if (error.code !== 'ENODATA' && error.code !== 'ENOTFOUND') {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc