data/ProxmoxProxy: set responseType to undefined for XMLHTTPRequest

extjs 7.0 gives the responseType to the XMLHTTPRequest (which
is 'json' for a json reader), but that means that the response is
automatically decoded by the browser, with no means to get the original
return back

in our case, for successful api calls it would work, but some of our
errors are plain text, not json, so the decoded json object is 'null'
and we lose the error information

revert the type to 'undefined' which tells the browser not do do any
decoding

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-05-26 10:58:29 +02:00 committed by Thomas Lamprecht
parent d00e8b940a
commit fba354621f
2 changed files with 2 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Ext.define('Proxmox.RestProxy', {
constructor: function(config) {
Ext.applyIf(config, {
reader: {
responseType: undefined,
type: 'json',
rootProperty: config.root || 'data',
},

View File

@ -32,6 +32,7 @@ Ext.define('Proxmox.data.reader.JsonObject', {
alias: 'reader.jsonobject',
readArray: false,
responseType: undefined,
rows: undefined,