Fix DNS modal to allow one char domains (#393)

* update regex to allow one char domains in DNS routing modal

* update regex
This commit is contained in:
pascal-fischer
2024-07-04 10:50:37 +02:00
committed by GitHub
parent 6ebee98695
commit e78c35bdbe

View File

@@ -42,7 +42,7 @@ export const sleep = (ms: number) => {
export const validator = {
isValidDomain: (domain: string) => {
const unicodeDomain =
/^(?!.*\s)(\.?[a-zA-Z0-9\u00A1-\uFFFF](?!.*\s$)(?!.*\.$)(?:(?!-)[a-zA-Z0-9\u00A1-\uFFFF-]{1,63}(?<!-)\.){0,126}(?!-)[a-zA-Z0-9\u00A1-\uFFFF-]{1,63}(?<!-))$/u;
/^(?!.*\.\.)(?!.*\.$)(?!.*\s)(?:(?!-)(?!.*--)[a-zA-Z0-9\u00A1-\uFFFF-]{1,63}(?<!-)\.)+(?!-)(?!.*--)[a-zA-Z0-9\u00A1-\uFFFF-]{2,63}$/u;
try {
const minMaxChars = [1, 255];
const isValidDomainLength =