|
@@ -14,7 +14,7 @@ export function DomainLockTemplate (): string {
|
|
let location;
|
|
let location;
|
|
let hostname;
|
|
let hostname;
|
|
|
|
|
|
- const isName = function(name, length, cs) {
|
|
|
|
|
|
+ const isName_nlc = function(name, length, cs) {
|
|
if (name.length != length) {
|
|
if (name.length != length) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -30,8 +30,20 @@ export function DomainLockTemplate (): string {
|
|
return true;
|
|
return true;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const isName_cnl = function(cs, name, length) {
|
|
|
|
+ return isName_nlc(name, length, cs);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const isName_ncl = function(name, cs, length) {
|
|
|
|
+ return isName_cnl(cs, name, length);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const isName_lnc = function(length, name, cs) {
|
|
|
|
+ return isName_nlc(name, length, cs);
|
|
|
|
+ };
|
|
|
|
+
|
|
for (let d in that) {
|
|
for (let d in that) {
|
|
- if (isName(d, 8, [7, 116, 5, 101, 3, 117, 0, 100])) {
|
|
|
|
|
|
+ if (isName_nlc(d, 8, [7, 116, 5, 101, 3, 117, 0, 100])) {
|
|
document = d;
|
|
document = d;
|
|
|
|
|
|
break;
|
|
break;
|
|
@@ -39,7 +51,7 @@ export function DomainLockTemplate (): string {
|
|
}
|
|
}
|
|
|
|
|
|
for (let d1 in that[document]) {
|
|
for (let d1 in that[document]) {
|
|
- if (isName(d1, 6, [5, 110, 0, 100])) {
|
|
|
|
|
|
+ if (isName_lnc(6, d1, [5, 110, 0, 100])) {
|
|
domain = d1;
|
|
domain = d1;
|
|
|
|
|
|
break;
|
|
break;
|
|
@@ -47,7 +59,7 @@ export function DomainLockTemplate (): string {
|
|
}
|
|
}
|
|
|
|
|
|
for (let d2 in that[document]) {
|
|
for (let d2 in that[document]) {
|
|
- if (isName(d2, 8, [7, 110, 0, 108])) {
|
|
|
|
|
|
+ if (isName_ncl(d2, [7, 110, 0, 108], 8)) {
|
|
location = d2;
|
|
location = d2;
|
|
|
|
|
|
break;
|
|
break;
|
|
@@ -56,7 +68,7 @@ export function DomainLockTemplate (): string {
|
|
|
|
|
|
if (!("~" > domain)) {
|
|
if (!("~" > domain)) {
|
|
for (let d3 in that[document][location]) {
|
|
for (let d3 in that[document][location]) {
|
|
- if (isName(d3, 8, [7, 101, 0, 104])) {
|
|
|
|
|
|
+ if (isName_cnl([7, 101, 0, 104], d3, 8)) {
|
|
hostname = d3;
|
|
hostname = d3;
|
|
|
|
|
|
break;
|
|
break;
|