Skip to content

Commit

Permalink
Fix viewer request function rewrite rules
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroslavPshenichnikov authored Dec 21, 2023
1 parent cc5ffcb commit 1903622
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docspace-viewer-request/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ export const handler = async (event, context, callback) => {

console.log("Tenant domain: %s", tenantDomain);

const workspaceRegex = /(\/products\/|\/addons\/|\.aspx)/i;
const confirmPageRegex = /confirm\.aspx/i;
const editorPageRegex = /\/Products\/Files\/DocEditor\.aspx/i;

if (workspaceRegex.test(request.uri) && !confirmPageRegex.test(request.uri))
if (editorPageRegex.test(request.uri))
{
const newurl = `https://${tenantDomain.replace('onlyoffice.com', 'onlyoffice.co')}${request.uri}?${request.querystring}`;
// const newurl = `https://${tenantDomain.replace('onlyoffice.io', 'teamlab.info')}${request.uri}?${request.querystring}`;
console.log("redirect to: %s", newurl);

const response = {
Expand Down

0 comments on commit 1903622

Please sign in to comment.