]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: cert upload: fix private key field sending empty string
authorMax Carrara <m.carrara@proxmox.com>
Tue, 14 Mar 2023 15:08:39 +0000 (16:08 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 17 Mar 2023 10:20:43 +0000 (11:20 +0100)
The private key's field is now excluded from the upload form's
JSON data if it's left empty.

Prior to this change, the form still used an empty string for the
private key's field, even if no key was provided by the user.
Because the key's field is marked as optional in the upload cert
API endpoint, JSONSchema validation would therefore fail.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Max Carrara <m.carrara@proxmox.com>
www/manager6/node/Certificates.js

index 29c173595d7cb5e5275bc97b8790641a19215564..a086581c881c15798e724b191cc931c52ff27b6e 100644 (file)
@@ -171,6 +171,9 @@ Ext.define('PVE.node.CertUpload', {
        onGetValues: function(values) {
            values.restart = 1;
            values.force = 1;
+           if (!values.key) {
+               delete values.key;
+           }
            return values;
        },
        items: [