diff --git a/lib/tls.js b/lib/tls.js index 588dce3139e378..3e7bcc2d5522d0 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -135,9 +135,10 @@ function check(hostParts, pattern, wildcards) { return false; // Check host parts from right to left first. - for (var i = hostParts.length - 1; i > 0; i -= 1) + for (var i = hostParts.length - 1; i > 0; i -= 1) { if (hostParts[i] !== patternParts[i]) return false; + } var hostSubdomain = hostParts[0]; var patternSubdomain = patternParts[0];