mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
replace deprecated substr() with slice() (#4468)
Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -203,7 +203,7 @@ module.exports = function httpAdapter(config) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (proxyElement[0] === '.' &&
|
if (proxyElement[0] === '.' &&
|
||||||
parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {
|
parsed.hostname.slice(parsed.hostname.length - proxyElement.length) === proxyElement) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ module.exports = function parseHeaders(headers) {
|
|||||||
|
|
||||||
utils.forEach(headers.split('\n'), function parser(line) {
|
utils.forEach(headers.split('\n'), function parser(line) {
|
||||||
i = line.indexOf(':');
|
i = line.indexOf(':');
|
||||||
key = utils.trim(line.substr(0, i)).toLowerCase();
|
key = utils.trim(line.slice(0, i)).toLowerCase();
|
||||||
val = utils.trim(line.substr(i + 1));
|
val = utils.trim(line.slice(i + 1));
|
||||||
|
|
||||||
if (key) {
|
if (key) {
|
||||||
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user