From 5b866a74511cda003681d91942c1140ee50b213d Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 12 Jun 2024 21:50:42 -0400 Subject: [PATCH] fix: isInternalUrl helper returns true for other cloud-hosted workspaces --- shared/utils/urls.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shared/utils/urls.ts b/shared/utils/urls.ts index 10f73b77d..c26d0a924 100644 --- a/shared/utils/urls.ts +++ b/shared/utils/urls.ts @@ -1,6 +1,6 @@ import escapeRegExp from "lodash/escapeRegExp"; import env from "../env"; -import { RESERVED_SUBDOMAINS, getBaseDomain, parseDomain } from "./domains"; +import { parseDomain } from "./domains"; /** * Prepends the CDN url to the given path (If a CDN is configured). @@ -37,8 +37,7 @@ export function isInternalUrl(href: string) { return ( outline.host === domain.host || - (domain.host.endsWith(getBaseDomain()) && - !RESERVED_SUBDOMAINS.find((reserved) => domain.host.startsWith(reserved))) + (typeof window !== "undefined" && window.location.hostname === domain.host) ); }