From 18a377aea21c7c0fde5281a99e0fefc701edbbac Mon Sep 17 00:00:00 2001 From: Jordan Ramos Date: Wed, 27 May 2026 18:06:07 -0600 Subject: [PATCH] Force IPv4 for CARD API requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit card.charter.com resolves to both IPv4 (47.43.51.7) and IPv6 (2600:6c7f:9340:ca5::7). IPv6 is unreachable from this network, causing Node.js to attempt IPv6 first, wait for timeout, then fall back — but the 15s request timeout fires before the fallback completes. Adding family: 4 to both acquireToken and doRequest forces IPv4 resolution, matching curl behavior. --- backend/helpers/cardApi.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/helpers/cardApi.js b/backend/helpers/cardApi.js index 12f591b..062b45b 100644 --- a/backend/helpers/cardApi.js +++ b/backend/helpers/cardApi.js @@ -57,6 +57,7 @@ function acquireToken(timeout) { port: fullUrl.port || (isHttps ? 443 : 80), path: fullUrl.pathname + fullUrl.search, method: 'POST', + family: 4, // Force IPv4 — IPv6 is unreachable from this network headers: { 'accept': 'application/json', 'authorization': 'Basic ' + authString, @@ -150,6 +151,7 @@ async function cardRequest(method, urlPath, body, options) { port: fullUrl.port || (isHttps ? 443 : 80), path: fullUrl.pathname + fullUrl.search, method, + family: 4, // Force IPv4 — IPv6 is unreachable from this network headers, timeout, };