mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
Merge remote-tracking branch 'remotes/origin/develop' into feature/jwtForDiffZip
# Conflicts: # web/documentserver-example/csharp-mvc/Models/FileModel.cs # web/documentserver-example/csharp/DocEditor.aspx.cs # web/documentserver-example/java/src/main/java/entities/FileModel.java # web/documentserver-example/nodejs/app.js # web/documentserver-example/php/common.php # web/documentserver-example/php/doceditor.php # web/documentserver-example/php/webeditor-ajax.php # web/documentserver-example/ruby/Gemfile # web/documentserver-example/ruby/app/models/document_helper.rb
This commit is contained in:
@ -123,8 +123,9 @@ app.get("/download", function (req, res) { // define a handler for downloading
|
||||
|
||||
var fileName = fileUtility.getFileName(req.query.fileName);
|
||||
var userAddress = req.query.useraddress;
|
||||
var isEmbedded = req.query.dmode;
|
||||
|
||||
if (cfgSignatureEnable && cfgSignatureUseForRequest) {
|
||||
if ((cfgSignatureEnable && cfgSignatureUseForRequest) && isEmbedded == null ) {
|
||||
var authorization = req.get(cfgSignatureAuthorizationHeader);
|
||||
if (authorization && authorization.startsWith(cfgSignatureAuthorizationHeaderPrefix)) {
|
||||
var token = authorization.substring(cfgSignatureAuthorizationHeaderPrefix.length);
|
||||
@ -185,7 +186,7 @@ app.post("/upload", function (req, res) { // define a handler for uploading fil
|
||||
docManager.storagePath(""); // mkdir if not exist
|
||||
|
||||
const userIp = docManager.curUserHostAddress(); // get the path to the user host
|
||||
const uploadDir = path.join(storageFolder, userIp);
|
||||
const uploadDir = path.isAbsolute(storageFolder) ? storageFolder : path.join(storageFolder, userIp);
|
||||
const uploadDirTmp = path.join(uploadDir, 'tmp'); // and create directory for temporary files if it doesn't exist
|
||||
docManager.createDirectory(uploadDirTmp);
|
||||
|
||||
@ -771,7 +772,7 @@ app.get("/editor", function (req, res) { // define a handler for editing docume
|
||||
}
|
||||
var key = docManager.getKey(fileName);
|
||||
var url = docManager.getDownloadUrl(fileName);
|
||||
var urlUser = docManager.getlocalFileUri(fileName, 0, false)
|
||||
var urlUser = path.isAbsolute(storageFolder) ? docManager.getDownloadUrl(fileName) + "&dmode=emb" : docManager.getlocalFileUri(fileName, 0, false);
|
||||
var mode = req.query.mode || "edit"; // mode: view/edit/review/comment/fillForms/embedded
|
||||
var type = req.query.type || ""; // type: embedded/mobile/desktop
|
||||
if (type == "") {
|
||||
@ -815,8 +816,8 @@ app.get("/editor", function (req, res) { // define a handler for editing docume
|
||||
key: historyData[i - 2].key,
|
||||
url: historyData[i - 2].url,
|
||||
};
|
||||
//historyD.changesUrl = docManager.getlocalFileUrFi(fileName, i - 1) + "/diff.zip"; // get the path to the diff.zip file and write it to the history object
|
||||
historyD.changesUrl = `${docManager.getServerUrl(false)}/zip?path=${encodeURIComponent(diffFilePath)}`
|
||||
let changesUrl = `${docManager.getServerUrl(false)}/zip?path=${encodeURIComponent(diffFilePath)}`;
|
||||
historyD.changesUrl = changesUrl.includes("diff.zip") ? changesUrl : changesUrl + "/diff.zip"; // get the path to the diff.zip file and write it to the history object
|
||||
}
|
||||
|
||||
historyData.push(historyD);
|
||||
|
||||
Reference in New Issue
Block a user