From 27306d46df5b3beba56b65f76ce5d238d0184764 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Sun, 27 Mar 2022 03:14:23 +0200 Subject: [PATCH] refactor: replace deprecated String.prototype.substr() .substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 3f819d1..a5b28d9 100644 --- a/index.js +++ b/index.js @@ -270,7 +270,7 @@ RedirectableRequest.prototype._performRequest = function () { // If specified, use the agent corresponding to the protocol // (HTTP and HTTPS use different types of agents) if (this._options.agents) { - var scheme = protocol.substr(0, protocol.length - 1); + var scheme = protocol.slice(0, -1); this._options.agent = this._options.agents[scheme]; }