Skip to content

Commit

Permalink
replace deprecated substr() with slice() (#4468)
Browse files Browse the repository at this point in the history
Co-authored-by: Jay <jasonsaayman@gmail.com>
  • Loading branch information
JLL32 and jasonsaayman committed May 3, 2022
1 parent ad27f80 commit eef2f97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/adapters/http.js
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/helpers/parseHeaders.js
Expand Up @@ -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) {
Expand Down

0 comments on commit eef2f97

Please sign in to comment.