From 7510e3572a30704c6722f930fa0b9da96532738f Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Thu, 6 Feb 2025 17:19:17 +0100 Subject: [PATCH] fix(frontend): resolve isAbsoluteUrl bug --- frontend/src/utils/URL.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils/URL.ts b/frontend/src/utils/URL.ts index ae04d67b..0c85749d 100644 --- a/frontend/src/utils/URL.ts +++ b/frontend/src/utils/URL.ts @@ -6,7 +6,6 @@ * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file). */ - export const getFromQuery = ({ key, search, @@ -49,7 +48,8 @@ export const isAbsoluteUrl = (value: string = ""): boolean => { return ( (url.protocol === "http:" || url.protocol === "https:") && - (url.href.startsWith("http://") || url.href.startsWith("https://")) && + ((url.href.startsWith("http://") && value.startsWith("http://")) || + (url.href.startsWith("https://") && value.startsWith("https://"))) && hostnameParts.length > 1 && hostnameParts[hostnameParts.length - 1].length > 1 );