fix: isInternalUrl helper returns true for other cloud-hosted workspaces
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import escapeRegExp from "lodash/escapeRegExp";
|
import escapeRegExp from "lodash/escapeRegExp";
|
||||||
import env from "../env";
|
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).
|
* Prepends the CDN url to the given path (If a CDN is configured).
|
||||||
@@ -37,8 +37,7 @@ export function isInternalUrl(href: string) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
outline.host === domain.host ||
|
outline.host === domain.host ||
|
||||||
(domain.host.endsWith(getBaseDomain()) &&
|
(typeof window !== "undefined" && window.location.hostname === domain.host)
|
||||||
!RESERVED_SUBDOMAINS.find((reserved) => domain.host.startsWith(reserved)))
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user