kns registration: disallow capital letters

This commit is contained in:
dr-frmr 2024-08-26 11:59:53 -04:00
parent a843278ee9
commit ae92859c91
No known key found for this signature in database
2 changed files with 9 additions and 3 deletions

View File

@ -3749,8 +3749,6 @@
},
"node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/napi-wasm/-/napi-wasm-1.1.0.tgz",
"integrity": "sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==",
"inBundle": true,
"license": "MIT"
},

View File

@ -47,6 +47,12 @@ function EnterKnsName({
let validities: string[] = [];
setIsPunyfied('');
if (/[A-Z]/.test(name)) {
validities.push(NAME_URL);
setNameValidities(validities);
return;
}
let normalized = ''
index = validities.indexOf(NAME_INVALID_PUNY);
try {
@ -69,7 +75,9 @@ function EnterKnsName({
index = validities.indexOf(NAME_URL);
if (name !== "" && !isValidDomain(normalized)) {
if (index === -1) validities.push(NAME_URL);
} else if (index !== -1) validities.splice(index, 1);
} else if (index !== -1) {
validities.splice(index, 1);
}
index = validities.indexOf(NAME_CLAIMED);