fix(xen-api/{get,put}Resource): correctly fetch host

Introduced by ea10df8a9
This commit is contained in:
Julien Fontanet
2021-08-30 15:18:55 +02:00
parent ca6f345429
commit ab4fcd6ac4
2 changed files with 5 additions and 2 deletions

View File

@@ -27,3 +27,6 @@
> - major: if the change breaks compatibility
>
> In case of conflict, the highest (lowest in previous list) `$version` wins.
- xen-api patch
- xo-server patch

View File

@@ -371,7 +371,7 @@ export class Xapi extends EventEmitter {
let url = new URL('http://localhost')
url.protocol = this._url.protocol
url.hostname = await this._getHostAddress(await this.getRecord('host', host ?? this._pool.master))
url.hostname = await this._getHostAddress(host ?? (await this.getRecord('host', this._pool.master)))
url.pathname = pathname
url.search = new URLSearchParams(query)
@@ -446,7 +446,7 @@ export class Xapi extends EventEmitter {
const url = new URL('http://localhost')
url.protocol = this._url.protocol
url.hostname = await this._getHostAddress(await this.getRecord('host', host ?? this._pool.master))
url.hostname = await this._getHostAddress(host ?? (await this.getRecord('host', this._pool.master)))
url.pathname = pathname
url.search = new URLSearchParams(query)