[pmg-devel] [PATCH pmg-gui 1/1] fix #2632: use alternative api call for user black/whitelist

Dominik Csapak d.csapak at proxmox.com
Mon Mar 9 12:18:17 CET 2020


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.apply (which copies the entries) here instead of setting
the value in 'params', since we get a reference to the proxy parameters
and do not want to change those, else we would overwrite them for all
subsequent api calls, like the reload of the list

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 js/UserBlackWhiteList.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/js/UserBlackWhiteList.js b/js/UserBlackWhiteList.js
index c103d54..23c4fa4 100644
--- a/js/UserBlackWhiteList.js
+++ b/js/UserBlackWhiteList.js
@@ -73,11 +73,11 @@ 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 = Ext.apply({
+		    address: records.map((rec) => rec.getId()).join(',')
+		},
+		me.getStore().getProxy().getExtraParams()
+	    );
 
 	    Proxmox.Utils.API2Request({
 		url: url + '?' + Ext.Object.toQueryString(params),
-- 
2.20.1




More information about the pmg-devel mailing list