mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-03 21:42:14 +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 errors = false;
|
||||
var error;
|
||||
|
||||
Ext.Array.each(value.split(','), function(p) {
|
||||
if (!p || p.match(/^\s*$/)) {
|
||||
return; //continue
|
||||
}
|
||||
|
||||
var match_res;
|
||||
if ((match_res = p.match(/^(?:domains=)?((?:[a-zA-Z0-9\-\.]+[;, ]?)+)$/)) !== null) {
|
||||
res.domains = match_res[1].split(/[;, ]/);
|
||||
var kv = p.split('=', 2);
|
||||
if (Ext.isDefined(kv[1])) {
|
||||
res[kv[0]] = kv[1];
|
||||
} else {
|
||||
errors = true;
|
||||
error = 'Failed to parse key-value pair: '+p;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if (errors || !res) {
|
||||
if (error !== undefined) {
|
||||
console.error(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (res.domains !== undefined) {
|
||||
res.domains = res.domains.split(/;/);
|
||||
}
|
||||
|
||||
return res;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user