Move dns.setDefaultResultOrder to server.js top-level

The DNS ipv4first setting must be applied before any module loads
the https/http modules. When set inside cardApi.js helper, it's
too late — the https module has already cached DNS resolution
behavior. Moving it to the very top of server.js ensures it
takes effect globally for all outbound connections.
This commit is contained in:
Jordan Ramos
2026-05-28 14:16:40 -06:00
parent 46dd2256f5
commit 93811eda10

View File

@@ -1,6 +1,10 @@
// CVE Management Backend API // CVE Management Backend API
// Install: npm install express pg multer cors dotenv bcryptjs cookie-parser // Install: npm install express pg multer cors dotenv bcryptjs cookie-parser
// Force IPv4-first DNS resolution globally — must be set before any network modules load.
// card.charter.com has IPv6 AAAA records that are unreachable from this network.
require('dns').setDefaultResultOrder('ipv4first');
require('dotenv').config(); require('dotenv').config();
const express = require('express'); const express = require('express');