From 82419f17dd4820033a658823a96e846c6f8d312d Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Tue, 6 Jun 2023 09:12:43 -0700 Subject: [PATCH] Don't shuffle dns addresses --- ts/util/createHTTPSAgent.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ts/util/createHTTPSAgent.ts b/ts/util/createHTTPSAgent.ts index b628f0a8522f..90ae3f2c2ac3 100644 --- a/ts/util/createHTTPSAgent.ts +++ b/ts/util/createHTTPSAgent.ts @@ -7,7 +7,6 @@ import type { LookupAddress } from 'dns'; import net from 'net'; import tls from 'tls'; import { callbackify, promisify } from 'util'; -import { shuffle } from 'lodash'; import pTimeout from 'p-timeout'; import * as log from '../logging/log'; @@ -55,8 +54,8 @@ export class Agent extends HTTPSAgent { throw new Error(`Agent.createConnection: failed to resolve ${host}`); } - const v4 = shuffle(addresses.filter(({ family }) => family === 4)); - const v6 = shuffle(addresses.filter(({ family }) => family === 6)); + const v4 = addresses.filter(({ family }) => family === 4); + const v6 = addresses.filter(({ family }) => family === 6); // Interleave addresses for Happy Eyeballs, but keep the first address // type from the DNS response first in the list.