api-viewer: ensure path starts with slash

should always be the case, but this is now an assumption, so better
to ensure it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-07-19 17:38:22 +02:00
parent 6cc360f2b4
commit f0de3268af

View File

@ -115,6 +115,9 @@ Ext.onReady(function() {
}; };
let real_path = function(path) { let real_path = function(path) {
if (!path.match(/^[/]/)) {
path = `/${path}`;
}
return path.replace(/^.*\/_upgrade_(\/)?/, "/"); return path.replace(/^.*\/_upgrade_(\/)?/, "/");
}; };