0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00

tls: pass linting

This commit is contained in:
Fedor Indutny 2012-07-20 22:07:16 +04:00
parent 92e7433ff9
commit 85185bbbaa

View File

@ -97,12 +97,11 @@ function checkServerIdentity(host, cert) {
// escape all characters that have special meaning in regexps
// (i.e. '.', '[', '{', '*', and others)
var re = host.replace(
/\*([a-z0-9\\-_\.])|[\.,\-\\\^\$+?*\[\]\(\):!\|{}]/g,
function(all, sub) {
if (sub) return '[a-z0-9\\-_]*' + (sub === '-' ? '\\-' : sub);
return '\\' + all;
}
);
/\*([a-z0-9\\-_\.])|[\.,\-\\\^\$+?*\[\]\(\):!\|{}]/g,
function(all, sub) {
if (sub) return '[a-z0-9\\-_]*' + (sub === '-' ? '\\-' : sub);
return '\\' + all;
});
return new RegExp('^' + re + '$', 'i');
}
@ -163,7 +162,7 @@ function checkServerIdentity(host, cert) {
}
return valid;
};
}
exports.checkServerIdentity = checkServerIdentity;