fix: escape file path

This commit is contained in:
DrosoCode 2021-06-04 17:55:02 +02:00
parent fe381b43c2
commit 60ce55b083

View File

@ -85,12 +85,11 @@ export default {
document.head.appendChild(onlyofficeScript);
onlyofficeScript.onload = () => {
let fileUrl = `${window.location.protocol}//
${window.location.host}${baseURL}/api/raw${url.encodePath(
let fileUrl = `${window.location.protocol}//${window.location.host}${baseURL}/api/raw${url.encodePath(
this.req.path
)}?auth=${this.jwt}`;
let key = Date.parse(this.req.modified).toString() + this.req.path;
let key = Date.parse(this.req.modified).toString() + url.encodePath(this.req.path);
key = key.replaceAll(/[-_.!~[\]*'()/,;:\-%+.]/g, "");
if (key.length > 127) {
key = key.substring(0, 127);