File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const {
4
4
ArrayPrototypeForEach,
5
- ArrayPrototypeJoin,
6
5
ArrayPrototypeMap,
7
6
ArrayPrototypePush,
8
7
FunctionPrototypeBind,
@@ -143,12 +142,15 @@ class ResolverBase {
143
142
}
144
143
145
144
[ 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
+ } ) ;
147
149
const errorNumber = this . _handle . setServers ( newSet ) ;
148
150
149
151
if ( errorNumber !== 0 ) {
150
152
// Reset the servers to the old servers, because ares probably unset them.
151
- this . _handle . setServers ( ArrayPrototypeJoin ( orig , ',' ) ) ;
153
+ this . _handle . setServers ( orig ) ;
152
154
const { strerror } = lazyBinding ( ) ;
153
155
const err = strerror ( errorNumber ) ;
154
156
throw new ERR_DNS_SET_SERVERS_FAILED ( err , servers ) ;
You can’t perform that action at this time.
0 commit comments