fix(xen-api/putResource): ensure taskRef is not sent on probing
This fix an issue introduced in ba6b9682
Fixes #3293.
This commit is contained in:
parent
c7d16fd345
commit
29fc17f260
@ -561,7 +561,7 @@ export class Xapi extends EventEmitter {
|
|||||||
headers['content-length'] = '1125899906842624'
|
headers['content-length'] = '1125899906842624'
|
||||||
}
|
}
|
||||||
|
|
||||||
const doRequest = override =>
|
const doRequest = (...opts) =>
|
||||||
httpRequest.put(
|
httpRequest.put(
|
||||||
$cancelToken,
|
$cancelToken,
|
||||||
this._url,
|
this._url,
|
||||||
@ -571,11 +571,12 @@ export class Xapi extends EventEmitter {
|
|||||||
{
|
{
|
||||||
body,
|
body,
|
||||||
headers,
|
headers,
|
||||||
|
query,
|
||||||
pathname,
|
pathname,
|
||||||
|
maxRedirects: 0,
|
||||||
rejectUnauthorized: !this._allowUnauthorized,
|
rejectUnauthorized: !this._allowUnauthorized,
|
||||||
},
|
},
|
||||||
override,
|
...opts
|
||||||
{ query }
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// if a stream, sends a dummy request to probe for a
|
// if a stream, sends a dummy request to probe for a
|
||||||
@ -586,8 +587,6 @@ export class Xapi extends EventEmitter {
|
|||||||
|
|
||||||
// omit task_id because this request will fail on purpose
|
// omit task_id because this request will fail on purpose
|
||||||
query: 'task_id' in query ? omit(query, 'task_id') : query,
|
query: 'task_id' in query ? omit(query, 'task_id') : query,
|
||||||
|
|
||||||
maxRedirects: 0,
|
|
||||||
}).then(
|
}).then(
|
||||||
response => {
|
response => {
|
||||||
response.req.abort()
|
response.req.abort()
|
||||||
@ -603,7 +602,8 @@ export class Xapi extends EventEmitter {
|
|||||||
statusCode,
|
statusCode,
|
||||||
} = response
|
} = response
|
||||||
if (statusCode === 302 && location !== undefined) {
|
if (statusCode === 302 && location !== undefined) {
|
||||||
return doRequest(location)
|
// ensure the original query is sent
|
||||||
|
return doRequest(location, { query })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user