diff --git a/lib/tls.js b/lib/tls.js index 082891c0760302..200a0dd9fec565 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -117,9 +117,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];