Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeMalkin committed Dec 18, 2023
1 parent 334c327 commit abe6fdd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docspace-reverse-proxy/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,18 @@ export const handler = async (event, context, callback) => {

// Redirect from DS to WS if match
const workspaceRegex = /(\/products\/|\/addons\/|.aspx)/i;

if (workspaceRegex.test(request.uri))
{
const newurl = `https://${tenantDomain.replace('onlyoffice.io', 'teamlab.info')}${request.uri}?${request.querystring}`;
console.log("redirect to: %s", newurl);
const response = {
status: '302',
statusDescription: 'Found',
headers: {
location: [{
key: 'Location',
value: `https://${tenantDomain.replace('onlyoffice.io', 'teamlab.info')}${request.uri}?${request.querystring}`,
value: newurl,
}],
},
};
Expand Down

0 comments on commit abe6fdd

Please sign in to comment.