chore(xen-api): expose bracketless IPv6 as hostnameRaw
This commit is contained in:
parent
0c97910349
commit
158a8e14a2
@ -36,6 +36,7 @@
|
|||||||
- @xen-orchestra/backups minor
|
- @xen-orchestra/backups minor
|
||||||
- @xen-orchestra/xapi major
|
- @xen-orchestra/xapi major
|
||||||
- complex-matcher patch
|
- complex-matcher patch
|
||||||
|
- xen-api patch
|
||||||
- xo-server patch
|
- xo-server patch
|
||||||
- xo-server-audit patch
|
- xo-server-audit patch
|
||||||
- xo-web minor
|
- xo-web minor
|
||||||
|
@ -954,6 +954,8 @@ export class Xapi extends EventEmitter {
|
|||||||
url,
|
url,
|
||||||
agent: this.httpAgent,
|
agent: this.httpAgent,
|
||||||
})
|
})
|
||||||
|
const { hostname } = url
|
||||||
|
url.hostnameRaw = hostname[0] === '[' ? hostname.slice(1, -1) : hostname
|
||||||
this._url = url
|
this._url = url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,14 +30,12 @@ const parseResult = result => {
|
|||||||
return result.Value
|
return result.Value
|
||||||
}
|
}
|
||||||
|
|
||||||
const removeBrackets = hostname => (hostname[0] === '[' ? hostname.slice(1, -1) : hostname)
|
export default ({ secureOptions, url: { hostnameRaw, pathname, port, protocol }, agent }) => {
|
||||||
|
|
||||||
export default ({ secureOptions, url: { hostname, pathname, port, protocol }, agent }) => {
|
|
||||||
const secure = protocol === 'https:'
|
const secure = protocol === 'https:'
|
||||||
const client = (secure ? createSecureClient : createClient)({
|
const client = (secure ? createSecureClient : createClient)({
|
||||||
...(secure ? secureOptions : undefined),
|
...(secure ? secureOptions : undefined),
|
||||||
agent,
|
agent,
|
||||||
host: removeBrackets(hostname),
|
host: hostnameRaw,
|
||||||
pathname,
|
pathname,
|
||||||
port,
|
port,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user