Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
tls: pass linting
  • Loading branch information
indutny committed Jul 20, 2012
1 parent 92e7433 commit 85185bb
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/tls.js
Expand Up @@ -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');
}
Expand Down Expand Up @@ -163,7 +162,7 @@ function checkServerIdentity(host, cert) {
}

return valid;
};
}
exports.checkServerIdentity = checkServerIdentity;


Expand Down

0 comments on commit 85185bb

Please sign in to comment.