nodejs: encode path in url for wopi

This commit is contained in:
Sergey Linnik
2025-02-19 11:31:15 +03:00
parent 1074735afc
commit f0ced2f587

View File

@ -150,7 +150,7 @@ const getDefaultAction = async function getDefaultAction(DocManager, ext) {
// get the action url
const getActionUrl = function getActionUrl(host, userAddress, action, filename) {
const WOPISrc = `${host}/wopi/files/${filename}@${userAddress}`;
const WOPISrc = `${host}/wopi/files/${encodeURIComponent(filename)}@${encodeURIComponent(userAddress)}`;
return `${action.urlsrc.replace(/<.*&>/g, '')}WOPISrc=${encodeURIComponent(WOPISrc)}`;
};