mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-04-07 14:04:35 +08:00
[bug] Add stubs for shardkey params until integrators pass these parameters to all requests
This commit is contained in:
@ -44,6 +44,10 @@ const constants = require('./../../Common/sources/constants');
|
||||
|
||||
const cfgExpSessionAbsolute = ms(config.get('services.CoAuthoring.expire.sessionabsolute'));
|
||||
|
||||
//Stubs are needed until integrators pass these parameters to all requests
|
||||
let shardKeyCached;
|
||||
let wopiSrcCached;
|
||||
|
||||
function getFilePath(storageCfg, strPath) {
|
||||
const storageFolderPath = storageCfg.fs.folderPath;
|
||||
return path.join(storageFolderPath, strPath);
|
||||
@ -142,10 +146,15 @@ async function getSignedUrl(ctx, storageCfg, baseUrl, strPath, urlType, optFilen
|
||||
url += '?md5=' + encodeURIComponent(md5);
|
||||
url += '&expires=' + encodeURIComponent(expires);
|
||||
if (ctx.shardKey) {
|
||||
shardKeyCached = ctx.shardKey;
|
||||
url += `&${constants.SHARD_KEY_API_NAME}=${encodeURIComponent(ctx.shardKey)}`;
|
||||
}
|
||||
if (ctx.wopiSrc) {
|
||||
} else if (ctx.wopiSrc) {
|
||||
wopiSrcCached = ctx.wopiSrc;
|
||||
url += `&${constants.SHARD_KEY_WOPI_NAME}=${encodeURIComponent(ctx.wopiSrc)}`;
|
||||
} else if (shardKeyCached) {
|
||||
url += `&${constants.SHARD_KEY_API_NAME}=${encodeURIComponent(shardKeyCached)}`;
|
||||
} else if (wopiSrcCached) {
|
||||
url += `&${constants.SHARD_KEY_WOPI_NAME}=${encodeURIComponent(wopiSrcCached)}`;
|
||||
}
|
||||
url += '&filename=' + userFriendlyName;
|
||||
return url;
|
||||
|
||||
Reference in New Issue
Block a user