From 3995a867a8b403df78e2b10ddee70c0f325a6b00 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Sat, 26 Mar 2022 12:55:41 +0100 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 --- src/common/providers/https.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/providers/https.ts b/src/common/providers/https.ts index 5cbc016a1..5421ebb7b 100644 --- a/src/common/providers/https.ts +++ b/src/common/providers/https.ts @@ -437,7 +437,7 @@ function isValidRequest(req: Request): req is HttpRequest { // If it has a charset, just ignore it for now. const semiColon = contentType.indexOf(';'); if (semiColon >= 0) { - contentType = contentType.substr(0, semiColon).trim(); + contentType = contentType.slice(0, semiColon).trim(); } if (contentType !== 'application/json') { logger.warn('Request has incorrect Content-Type.', contentType);