mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-11-09 17:06:13 -06:00
fix(xen-api): don't normalize/trim strings in XML-RPC
This applies to both XML-RPC transport and results of XAPI tasks. Before this commit, all whitespaces (spaces, new lines, etc.) were reduces to a single whitespaces and leading and trailing whitespaces where removed. This led to malformed values such as the result of `host.get_server_certificate`.
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
- @xen-orchestra/web minor
|
||||
- @xen-orchestra/web-core minor
|
||||
- @xen-orchestra/xapi patch
|
||||
- xen-api patch
|
||||
- xo-cli minor
|
||||
- xo-server patch
|
||||
- xo-web minor
|
||||
|
||||
@@ -20,6 +20,8 @@ export default task => {
|
||||
// - an opaque reference
|
||||
// - an XML-RPC value
|
||||
const { result } = task
|
||||
return Promise.resolve(result === '' ? '' : xmlRpcParser.parse_value(parseXml(result)))
|
||||
return Promise.resolve(
|
||||
result === '' ? '' : xmlRpcParser.parse_value(parseXml(result + '\n', { normalize: false, trim: false }))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ export default ({ dispatcher, url }) => {
|
||||
}
|
||||
|
||||
const xml = await res.body.text()
|
||||
const response = xmlRpcParser.parse(parseXml(xml))
|
||||
const response = xmlRpcParser.parse(parseXml(xml, { normalize: false, trim: false }))
|
||||
|
||||
return parseResult(response.params[0])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user