Skip to content

Commit baa29f9

Browse files
committed
Enhance domain handling in getMyDomain function to support additional Salesforce host formats. This update allows for proper handling of internal hosts, improving the robustness of the Salesforce connection logic.
1 parent b701179 commit baa29f9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

addon/inspector.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ function getMyDomain(host) {
445445
if (host) {
446446
const myDomain = host
447447
.replace(/\.lightning\.force\./, ".my.salesforce.") //avoid HTTP redirect (that would cause Authorization header to be dropped)
448+
.replace(/\.lightning\.([^.]+)\.force\.com$/, ".my.$1.salesforce.com") // handle hosts like *.lightning.xx-xxx.force.com
448449
.replace(/\.mcas\.ms$/, ""); //remove trailing .mcas.ms if the client uses Microsoft Defender for Cloud Apps
449450
return myDomain;
450451
}

0 commit comments

Comments
 (0)