From 3bb0c7216f3b85aaa4959367134992da5b88ed65 Mon Sep 17 00:00:00 2001 From: Michael Malave Date: Wed, 3 Sep 2025 16:44:14 -0700 Subject: [PATCH] updating to include an alternate url when api.url.com does not exist --- src/api-client.ts | 2 +- src/vars.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api-client.ts b/src/api-client.ts index 96b0408..bbfa6a6 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -169,7 +169,7 @@ export class APIClient { targetUrl = new URL(url, vars.apiUrl) } - const isHerokuApi = ALLOWED_HEROKU_DOMAINS.some(domain => targetUrl.hostname.endsWith(`.${domain}`)) + const isHerokuApi = ALLOWED_HEROKU_DOMAINS.some(domain => targetUrl.hostname.endsWith(`.${domain}`) || targetUrl.hostname === domain) const isLocalhost = LOCALHOST_DOMAINS.includes(targetUrl.hostname as (typeof LOCALHOST_DOMAINS)[number]) if (isHerokuApi || isLocalhost) { diff --git a/src/vars.ts b/src/vars.ts index 628b286..b87cf7d 100644 --- a/src/vars.ts +++ b/src/vars.ts @@ -77,7 +77,7 @@ export class Vars { // Remove protocol if present const cleanHost = host.replace(/^https?:\/\//, '') - return ALLOWED_HEROKU_DOMAINS.some(domain => cleanHost.endsWith(`.${domain}`)) || LOCALHOST_DOMAINS.some(domain => cleanHost.includes(domain)) + return ALLOWED_HEROKU_DOMAINS.some(domain => cleanHost.endsWith(`.${domain}`) || cleanHost === domain) || LOCALHOST_DOMAINS.some(domain => cleanHost.includes(domain)) } }