From 4574f2e229c5726756485b4fb4c6d05a6d842f84 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Thu, 6 Feb 2025 17:14:38 +0100 Subject: [PATCH] fix(frontend): resolve isAbsoluteUrl bug --- frontend/src/utils/URL.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/utils/URL.ts b/frontend/src/utils/URL.ts index dc1c20d9..ae04d67b 100644 --- a/frontend/src/utils/URL.ts +++ b/frontend/src/utils/URL.ts @@ -1,11 +1,12 @@ /* - * Copyright © 2024 Hexastack. All rights reserved. + * Copyright © 2025 Hexastack. All rights reserved. * * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms: * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission. * 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, @@ -48,6 +49,7 @@ export const isAbsoluteUrl = (value: string = ""): boolean => { return ( (url.protocol === "http:" || url.protocol === "https:") && + (url.href.startsWith("http://") || url.href.startsWith("https://")) && hostnameParts.length > 1 && hostnameParts[hostnameParts.length - 1].length > 1 );