diff --git a/Common/sources/storage-fs.js b/Common/sources/storage-fs.js index 4729b2b8..3257dc2f 100644 --- a/Common/sources/storage-fs.js +++ b/Common/sources/storage-fs.js @@ -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;