Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeybannov committed Jan 29, 2024
1 parent c430bfa commit 1b8b05d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docspace-reverse-proxy/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,17 @@ export const handler = async (event, context, callback) => {

let originDomain;

if (request.uri == "/apisystem/portal/register" && request.method == "POST") {
if (request.uri.toLowerCase() == "/apisystem/portal/register" && request.method == "POST") {
console.log("this is body %s", request.body);

let body = JSON.parse(Buffer.from(request.body.data, 'base64').toString('utf8'));
let regionFromRequest = body["awsRegion"];
let portalName = body["portalName"];

if(regionFromRequest !== null && regionFromRequest !== '' && regionFromRequest!==undefined) {
regionFromRequest = regionFromRequest.toLowerCase();
}

originDomain = regionsMap[regionFromRequest];

console.log("Register portal request: Origin Domain is %s, awsRegion is %s", originDomain, regionFromRequest);
Expand Down

0 comments on commit 1b8b05d

Please sign in to comment.