Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions express/code/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const [setLibs, getLibs] = (() => {
const { hostname, search } = location || window.location;
if (!['.aem.', '.hlx.', '.stage.', 'local', '.da.'].some((i) => hostname.includes(i))) return prodLibs;
const branch = new URLSearchParams(search).get('milolibs') || 'main';
if (!/^[a-zA-Z0-9_-]+$/.test(branch)) throw new Error('Invalid branch name.');
if (branch === 'local') return 'http://localhost:6456/libs';
if (branch === 'main' && hostname.includes('.stage.')) return '/libs';
return branch.includes('--') ? `https://${branch}.aem.live/libs` : `https://${branch}--milo--adobecom.aem.live/libs`;
Expand Down
Loading