fix: isInternalUrl helper returns true for other cloud-hosted workspaces

This commit is contained in:
Tom Moor
2024-06-12 21:50:42 -04:00
parent 4ef3615516
commit 5b866a7451

View File

@@ -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)
);
}