mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-08 08:26:08 +00:00
www: fix acme parser
not yet for the new features/keys, but the old one was broken already.. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
922f7b07f4
commit
08a61c7b30
@ -11,26 +11,27 @@ Ext.define('PVE.Parser', { statics: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var res = {};
|
var res = {};
|
||||||
var errors = false;
|
var error;
|
||||||
|
|
||||||
Ext.Array.each(value.split(','), function(p) {
|
Ext.Array.each(value.split(','), function(p) {
|
||||||
if (!p || p.match(/^\s*$/)) {
|
var kv = p.split('=', 2);
|
||||||
return; //continue
|
if (Ext.isDefined(kv[1])) {
|
||||||
}
|
res[kv[0]] = kv[1];
|
||||||
|
|
||||||
var match_res;
|
|
||||||
if ((match_res = p.match(/^(?:domains=)?((?:[a-zA-Z0-9\-\.]+[;, ]?)+)$/)) !== null) {
|
|
||||||
res.domains = match_res[1].split(/[;, ]/);
|
|
||||||
} else {
|
} else {
|
||||||
errors = true;
|
error = 'Failed to parse key-value pair: '+p;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (errors || !res) {
|
if (error !== undefined) {
|
||||||
|
console.error(error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res.domains !== undefined) {
|
||||||
|
res.domains = res.domains.split(/;/);
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user