]> git.proxmox.com Git - pmg-gui.git/commitdiff
fix #2632: use alternative api call for user black/whitelist
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 11 Mar 2020 11:03:34 +0000 (12:03 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 11 Mar 2020 11:07:29 +0000 (12:07 +0100)
which expects the entry as parameter instead of part of the path
this allows all special characters to be included in the entry

in the url, some characters were problematic (e.g. '/') and not properly
handled by the api in the backend

we use Ext.applyIf (which copies the non-existant entries to params) here
instead of getting the ExtraParams from the proxy and setting '.address'
(that would modify the ExtraParams of the proxy and send unwanted
parameters to subsequent api calls like the list-loading)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
js/UserBlackWhiteList.js

index c103d54b5a1ff9d9232715fd22551c0864549938..dd681a072e867515feaaf01a2239d374053e8484 100644 (file)
@@ -73,11 +73,10 @@ Ext.define('PMG.UserBlackWhiteList', {
 
            var url = '/quarantine/' + me.listname + '/';
 
-           url += records.map(function(rec) {
-               return encodeURIComponent(rec.getId());
-           }).join(',');
-
-           var params = me.getStore().getProxy().getExtraParams() || {};
+           let params = {
+               address: records.map((rec) => rec.getId()).join(','),
+           };
+           Ext.applyIf(params, me.getStore().getProxy().getExtraParams());
 
            Proxmox.Utils.API2Request({
                url: url + '?' + Ext.Object.toQueryString(params),