diff --git a/lib/adapters/http.js b/lib/adapters/http.js index afb44111d0..493725031f 100755 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -203,7 +203,7 @@ module.exports = function httpAdapter(config) { return true; } if (proxyElement[0] === '.' && - parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { + parsed.hostname.slice(parsed.hostname.length - proxyElement.length) === proxyElement) { return true; } diff --git a/lib/helpers/parseHeaders.js b/lib/helpers/parseHeaders.js index 8af2cc7f1b..9b4bfc6eec 100644 --- a/lib/helpers/parseHeaders.js +++ b/lib/helpers/parseHeaders.js @@ -34,8 +34,8 @@ module.exports = function parseHeaders(headers) { utils.forEach(headers.split('\n'), function parser(line) { i = line.indexOf(':'); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); + key = utils.trim(line.slice(0, i)).toLowerCase(); + val = utils.trim(line.slice(i + 1)); if (key) { if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {