From 906ca61b60ffd3c0b58f60e471352739d8c322d9 Mon Sep 17 00:00:00 2001 From: Gauthier Date: Thu, 13 Jun 2024 00:14:30 +0200 Subject: [PATCH] fix: bypass cacheable-lookup when resolving localhost --- server/index.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/server/index.ts b/server/index.ts index 6d970c80..a9a74656 100644 --- a/server/index.ts +++ b/server/index.ts @@ -59,15 +59,12 @@ app const originalLookup = cacheable.lookup; // if hostname is localhost use dns.lookup instead of cacheable-lookup - cacheable.lookup = ( - hostname: string, - options: any, - callback?: any - ): void => { + cacheable.lookup = (...args: any) => { + const [hostname] = args; if (hostname === 'localhost') { - return lookup(hostname, options); + lookup(...(args as Parameters)); } else { - return originalLookup(hostname, options, callback); + originalLookup(...(args as Parameters)); } };