generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding central georouting support from federal repo * Unit test case Update * Unit test case Update * Remove console * Creating a helper file for feds utils function * Removing blog from default allowed list * Updating georouting fetch calls * Lint fix * Test case update * Renaming fedshelper file * Updating test file
- Loading branch information
1 parent
7698b38
commit 5b64cf1
Showing
7 changed files
with
119 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { getConfig } from './utils.js'; | ||
|
||
let federatedContentRoot; | ||
/* eslint-disable import/prefer-default-export */ | ||
export const getFederatedContentRoot = () => { | ||
const cdnWhitelistedOrigins = [ | ||
'https://www.adobe.com', | ||
'https://business.adobe.com', | ||
'https://blog.adobe.com', | ||
'https://milo.adobe.com', | ||
'https://news.adobe.com', | ||
]; | ||
const { allowedOrigins = [] } = getConfig(); | ||
if (federatedContentRoot) return federatedContentRoot; | ||
|
||
const { origin } = window.location; | ||
|
||
federatedContentRoot = [...allowedOrigins, ...cdnWhitelistedOrigins].some((o) => origin.replace('.stage', '') === o) | ||
? origin | ||
: 'https://www.adobe.com'; | ||
|
||
if (origin.includes('localhost') || origin.includes('.hlx.')) { | ||
// Akamai as proxy to avoid 401s, given AEM-EDS MS auth cross project limitations | ||
federatedContentRoot = origin.includes('.hlx.live') | ||
? 'https://main--federal--adobecom.hlx.live' | ||
: 'https://www.stage.adobe.com'; | ||
} | ||
|
||
return federatedContentRoot; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters