]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
data/ProxmoxProxy: set responseType to undefined for XMLHTTPRequest
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 26 May 2021 08:58:29 +0000 (10:58 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 27 May 2021 11:37:36 +0000 (13:37 +0200)
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>
src/data/ProxmoxProxy.js
src/data/reader/JsonObject.js

index f716113ff9b26d136d02ef9753d02e25eea02eb1..d4dfe221007d9a618b0388dff737235b18ad8d35 100644 (file)
@@ -17,6 +17,7 @@ Ext.define('Proxmox.RestProxy', {
     constructor: function(config) {
        Ext.applyIf(config, {
            reader: {
+               responseType: undefined,
                type: 'json',
                rootProperty: config.root || 'data',
            },
index fff774dadbba769ecb86280f04b013ebc0686e25..4298066979e0d54bf419496c01700d04bd653001 100644 (file)
@@ -32,6 +32,7 @@ Ext.define('Proxmox.data.reader.JsonObject', {
     alias: 'reader.jsonobject',
 
     readArray: false,
+    responseType: undefined,
 
     rows: undefined,