@nxtedition/nxt-undici 3.1.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,17 +53,17 @@ export default (opts) => (dispatch) => (opts, handler) => {
53
53
  const url = new URL(opts.origin)
54
54
  const hostname = url.hostname
55
55
 
56
- const callback = (err, address) => {
56
+ const callback = (err, entries) => {
57
57
  if (err) {
58
58
  handler.onConnect(() => {})
59
59
  handler.onError(err)
60
60
  } else {
61
- url.hostname = address
61
+ url.hostname = entries[entries.length * Math.random()].address
62
62
  dispatch({ ...opts, origin: url.origin }, new Handler(opts, hostname, { handler }))
63
63
  }
64
64
  }
65
65
 
66
- const thenable = dns.lookup(new URL(opts.origin), callback)
66
+ const thenable = dns.lookup(new URL(opts.origin), { all: true }, callback)
67
67
  if (typeof thenable?.then === 'function') {
68
68
  thenable.then(
69
69
  (val) => callback(null, val),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",