From f0de3268af7c3afc59cad8a487fe1b0c14cf77da Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 19 Jul 2021 17:38:22 +0200 Subject: [PATCH] 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 --- src/api-viewer/APIViewer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/api-viewer/APIViewer.js b/src/api-viewer/APIViewer.js index 8f3759e..c6580bb 100644 --- a/src/api-viewer/APIViewer.js +++ b/src/api-viewer/APIViewer.js @@ -115,6 +115,9 @@ Ext.onReady(function() { }; let real_path = function(path) { + if (!path.match(/^[/]/)) { + path = `/${path}`; + } return path.replace(/^.*\/_upgrade_(\/)?/, "/"); };