GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — dns: call handle.setServers() with a valid array · nodejs/node@d5c16f8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/dns
    • utils.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/dns/utils.js‎

Copy file name to clipboardExpand all lines: lib/internal/dns/utils.js
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const {
44
ArrayPrototypeForEach,
5-
ArrayPrototypeJoin,
65
ArrayPrototypeMap,
76
ArrayPrototypePush,
87
FunctionPrototypeBind,
@@ -143,12 +142,15 @@ class ResolverBase {
143142
}
144143

145144
[kSetServersInteral](newSet, servers) {
146-
const orig = this._handle.getServers() || [];
145+
const orig = ArrayPrototypeMap(this._handle.getServers() || [], (val) => {
146+
val.unshift(isIP(val[0]));
147+
return val;
148+
});
147149
const errorNumber = this._handle.setServers(newSet);
148150

149151
if (errorNumber !== 0) {
150152
// Reset the servers to the old servers, because ares probably unset them.
151-
this._handle.setServers(ArrayPrototypeJoin(orig, ','));
153+
this._handle.setServers(orig);
152154
const { strerror } = lazyBinding();
153155
const err = strerror(errorNumber);
154156
throw new ERR_DNS_SET_SERVERS_FAILED(err, servers);

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.