From 7dbed1701150998b6db56f41867b0f6f5cb4c33c Mon Sep 17 00:00:00 2001 From: Robert Bogos <146744221+robert-bogos@users.noreply.github.com> Date: Thu, 20 Jun 2024 23:38:56 +0300 Subject: [PATCH] extended non prod hostname check (#53) --- blog/scripts/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/scripts/utils.js b/blog/scripts/utils.js index 1ae323e..cf261f4 100644 --- a/blog/scripts/utils.js +++ b/blog/scripts/utils.js @@ -19,7 +19,7 @@ export const [setLibs, getLibs] = (() => { (prodLibs, location) => { libs = (() => { const { hostname, search } = location || window.location; - if (!(hostname.includes('.hlx.') || hostname.includes('local'))) return prodLibs; + if (!['.hlx.', '.stage.', 'local'].some((i) => hostname.includes(i))) return prodLibs; const branch = new URLSearchParams(search).get('milolibs') || 'main'; if (branch === 'local') return 'http://localhost:6456/libs'; return branch.includes('--') ? `https://${branch}.hlx.live/libs` : `https://${branch}--milo--adobecom.hlx.live/libs`;