Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

fix: update hostname regex in isValidURL function for improved validation

Muhammad Hamza Khanf7ffbe2be03b
diff --git a/packages/app/src/react/features/agent-settings/utils/index.ts b/packages/app/src/react/features/agent-settings/utils/index.ts
index 00f348fa..cf097872 100644
--- a/packages/app/src/react/features/agent-settings/utils/index.ts
+++ b/packages/app/src/react/features/agent-settings/utils/index.ts
@@ -188,7 +188,7 @@ export const isValidURL = (url: string): boolean => {
// 2. Check for valid hostname format
const hostnameRegex =
- /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(\.[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])*$/;
+ /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(\.[a-zA-Z0-9]|\.[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])*$/;
if (!hostnameRegex.test(parsedUrl.hostname)) return false;
return true;