Skip to content

Commit 83246d6

Browse files
fix: increase TLD length regex (#886)
30 matches the Second Level Domain length limit. This should allow for TLDs longer than 2 or 3 characters, such as .solutions Co-authored-by: dicedtomato <[email protected]>
1 parent ac41dab commit 83246d6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/pages/serverSettings/parts/Domains.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useNavigate } from 'react-router-dom';
77
import { settingsOnSubmit } from '../settingsOnSubmit';
88

99
const DOMAIN_REGEX =
10-
/^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,3})$/gim;
10+
/^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,30})$/gim;
1111

1212
export default function Domains({
1313
swr: { data, isLoading },

src/server/routes/api/server/settings/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export default fastifyPlugin(
321321
z
322322
.string()
323323
.regex(
324-
/^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,3})$/gi,
324+
/^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,30})$/gi,
325325
'Invalid Domain',
326326
),
327327
),

0 commit comments

Comments
 (0)