@nxtedition/nxt-undici 4.2.2 → 4.2.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.
@@ -57,9 +57,9 @@ export default (interceptorOpts) => (dispatch) => (opts, handler) => {
57
57
 
58
58
  assert(typeof resolver.lookup === 'function')
59
59
 
60
- const { hostname } = new URL(opts.origin)
60
+ const { hostname, host } = new URL(opts.origin)
61
61
 
62
- if (net.isIP(hostname)) {
62
+ if (net.isIP(hostname) || opts.headers?.host) {
63
63
  return dispatch(opts, handler)
64
64
  }
65
65
 
@@ -72,7 +72,11 @@ export default (interceptorOpts) => (dispatch) => (opts, handler) => {
72
72
  ? val[Math.floor(val.length * Math.random())].address
73
73
  : val?.address ?? val
74
74
  dispatch(
75
- { ...opts, origin: url.origin, headers: { ...opts.headers, host: url.host } },
75
+ {
76
+ ...opts,
77
+ origin: url.origin,
78
+ headers: { ...opts.headers, host },
79
+ },
76
80
  resolver.clear ? new Handler({ resolver, key: hostname }, { handler }) : handler,
77
81
  )
78
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "4.2.2",
3
+ "version": "4.2.3",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",