diff --git a/lib/_http_client.js b/lib/_http_client.js index 5b568628006d68..70b0488f43dbfb 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -51,20 +51,7 @@ const errors = require('internal/errors'); // This function is used in the case of small paths, where manual character code // checks can greatly outperform the equivalent regexp (tested in V8 5.4). function isInvalidPath(s) { - var i = 0; - if (s.charCodeAt(0) <= 32) return true; - if (++i >= s.length) return false; - if (s.charCodeAt(1) <= 32) return true; - if (++i >= s.length) return false; - if (s.charCodeAt(2) <= 32) return true; - if (++i >= s.length) return false; - if (s.charCodeAt(3) <= 32) return true; - if (++i >= s.length) return false; - if (s.charCodeAt(4) <= 32) return true; - if (++i >= s.length) return false; - if (s.charCodeAt(5) <= 32) return true; - ++i; - for (; i < s.length; ++i) + for (var i = 0; i < s.length; ++i) if (s.charCodeAt(i) <= 32) return true; return false; }