From 8fa8965512e8774bc9cbec7f347ce3664eb6e05f Mon Sep 17 00:00:00 2001 From: Yaroslav Pshenichnikov Date: Tue, 19 Dec 2023 11:26:43 +0300 Subject: [PATCH] FIX viewer request function --- docspace-viewer-request/index.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docspace-viewer-request/index.mjs b/docspace-viewer-request/index.mjs index 7af5bbc..6d5bedd 100644 --- a/docspace-viewer-request/index.mjs +++ b/docspace-viewer-request/index.mjs @@ -9,6 +9,8 @@ export const handler = async (event, context, callback) => { const headers = request.headers; let tenantDomain = headers.host[0].value; + const workspaceRegex = /(\/products\/|\/addons\/|.aspx)/i; + if (workspaceRegex.test(request.uri)) { const newurl = `https://${tenantDomain.replace('onlyoffice.io', 'teamlab.info')}${request.uri}?${request.querystring}`;