tls: pass linting
This commit is contained in:
parent
50122fed8a
commit
42c6952edb
13
lib/tls.js
13
lib/tls.js
@ -97,12 +97,11 @@ function checkServerIdentity(host, cert) {
|
|||||||
// escape all characters that have special meaning in regexps
|
// escape all characters that have special meaning in regexps
|
||||||
// (i.e. '.', '[', '{', '*', and others)
|
// (i.e. '.', '[', '{', '*', and others)
|
||||||
var re = host.replace(
|
var re = host.replace(
|
||||||
/\*([a-z0-9\\-_\.])|[\.,\-\\\^\$+?*\[\]\(\):!\|{}]/g,
|
/\*([a-z0-9\\-_\.])|[\.,\-\\\^\$+?*\[\]\(\):!\|{}]/g,
|
||||||
function(all, sub) {
|
function(all, sub) {
|
||||||
if (sub) return '[a-z0-9\\-_]*' + (sub === '-' ? '\\-' : sub);
|
if (sub) return '[a-z0-9\\-_]*' + (sub === '-' ? '\\-' : sub);
|
||||||
return '\\' + all;
|
return '\\' + all;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
return new RegExp('^' + re + '$', 'i');
|
return new RegExp('^' + re + '$', 'i');
|
||||||
}
|
}
|
||||||
@ -163,7 +162,7 @@ function checkServerIdentity(host, cert) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return valid;
|
return valid;
|
||||||
};
|
}
|
||||||
exports.checkServerIdentity = checkServerIdentity;
|
exports.checkServerIdentity = checkServerIdentity;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user