From b584aaf3f43fdc039359312e993235ce645b0b9a Mon Sep 17 00:00:00 2001 From: shigahi <29591085+shigahi@users.noreply.github.com> Date: Mon, 15 Jun 2026 11:08:38 +0200 Subject: [PATCH] Fix domain validation to allow digits in labels and short labels Validate each domain label independently (alphanumeric plus hyphens, not leading/trailing) and restrict only the TLD to letters. Fixes domains like test.app1e.com being rejected. Closes #113 --- src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index ef3b78c..9e68a66 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -69,7 +69,7 @@ const DEFAULT_NOTION_URL = "https://succinct-scar-f20.notion.site/Sample-Web-Site-148f2fc322e74473a91fb4d90836e3ce"; const DOMAIN_PATTERN = - /^((https:\/\/)|(http:\/\/))?[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+(\/)?$/; + /^(https?:\/\/)?([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}\/?$/; const NOTION_ID_PATTERN = /[0-9a-f]{32}/; function isValidDomain(domain: string): boolean {