diff --git a/desktop/core/src/desktop/static/desktop/js/file-display-inline.js b/desktop/core/src/desktop/static/desktop/js/file-display-inline.js index 61756618644..5ce870d9127 100644 --- a/desktop/core/src/desktop/static/desktop/js/file-display-inline.js +++ b/desktop/core/src/desktop/static/desktop/js/file-display-inline.js @@ -64,7 +64,8 @@ // In this case we don't want to sanitize the path for XSS as we want exact match on the actual file name, // so to prevent breaking the page on substitution we enforce a js compatible string by only encoding the backtick // char (`) with a js decode to restore it in case file actually has backtick in the name. - const decodedPath = `/user/admin/ai_case.txt`.replaceAll('`', '`'); + + const decodedPath = FileViewOptions.path.replaceAll('`', '`'); const encodedPath = encodeURIComponent(decodedPath); const pathPrefix = "/filebrowser/view="; const contentPath = pathPrefix+encodedPath;