From 81dcfb3228bb39b511fbc0eb821592d2fbde2f39 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 29 Aug 2024 11:54:46 -0500 Subject: [PATCH] feat: workspaces support for myDomain checks --- src/util/sfdcUrl.ts | 1 + test/unit/util/sfdcUrl.test.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/util/sfdcUrl.ts b/src/util/sfdcUrl.ts index a1dd3dfb4..53dd811cb 100644 --- a/src/util/sfdcUrl.ts +++ b/src/util/sfdcUrl.ts @@ -135,6 +135,7 @@ export class SfdcUrl extends URL { '.stm.salesforce.ms', '.pc-rnd.force.com', '.pc-rnd.salesforce.com', + '.wc.crm.dev', // workspaces container ]; return ( this.origin.startsWith('https://gs1.') || diff --git a/test/unit/util/sfdcUrl.test.ts b/test/unit/util/sfdcUrl.test.ts index 3d00a6d76..0abe9dd54 100644 --- a/test/unit/util/sfdcUrl.test.ts +++ b/test/unit/util/sfdcUrl.test.ts @@ -179,6 +179,11 @@ describe('util/sfdcUrl', () => { expect(url.isInternalUrl()).to.equal(true); expect(url.isLocalUrl()).to.equal(true); }); + it('workspaces with port is internal but not local', () => { + const url = new SfdcUrl('https://dev.salesforce-com.shane-mclaughlin-0lrfx7zp3l121.wc.crm.dev:6101/'); + expect(url.isInternalUrl()).to.equal(true); + expect(url.isLocalUrl()).to.equal(false); + }); }); describe('checkLightningDomain', () => {