From 8495bb0ae2365d080ba766908efe44203b6f1a54 Mon Sep 17 00:00:00 2001 From: Zai Shi Date: Mon, 15 Apr 2024 14:44:24 +0200 Subject: [PATCH] fixed 127.0.0.1 not recognized as localhost --- packages/stack-server/src/utils/url.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stack-server/src/utils/url.tsx b/packages/stack-server/src/utils/url.tsx index fa583f297..561a99a80 100644 --- a/packages/stack-server/src/utils/url.tsx +++ b/packages/stack-server/src/utils/url.tsx @@ -1,7 +1,7 @@ import { DomainConfigJson } from "@stackframe/stack-shared/dist/interface/clientInterface"; export function validateUrl(url: string, domains: DomainConfigJson[], allowLocalhost: boolean): boolean { - if (allowLocalhost && new URL(url).hostname === "localhost") { + if (allowLocalhost && new URL(url).hostname === "localhost" && new URL(url).hostname === "127.0.0.1") { return true; } return domains.some((domain) => {