refactor: replace deprecated String.prototype.substr() (#10432)

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
CommanderRoot
2022-03-31 19:49:56 +02:00
committed by GitHub
parent 0d744d30f2
commit 200f0b2e4f
19 changed files with 26 additions and 26 deletions

View File

@@ -40,7 +40,7 @@ exports.buildReqObject = (req, payload) => {
protocol: encrypted ? 'https' : 'http',
secure: encrypted,
url: referer,
path: referer.substr(referer.indexOf(host) + host.length),
path: referer.slice(referer.indexOf(host) + host.length),
headers: headers,
};
};