Skip to content

Commit

Permalink
Update index.mjs
Browse files Browse the repository at this point in the history
Add exception in test
  • Loading branch information
SergeMalkin authored Dec 20, 2023
1 parent 97d4d31 commit 6540c78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docspace-viewer-request/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ export const handler = async (event, context, callback) => {
console.log("Tenant domain: %s", tenantDomain);

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

if (workspaceRegex.test(request.uri))
if (workspaceRegex.test(request.uri) && !confirmPageRegex.test(request.uri))
{
const newurl = `https://${tenantDomain.replace('onlyoffice.com', 'onlyoffice.co')}${request.uri}?${request.querystring}`;
// 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 All @@ -37,4 +39,4 @@ export const handler = async (event, context, callback) => {
}

return callback(null, request);
}
}

0 comments on commit 6540c78

Please sign in to comment.