From bd702d2f007332dedcd4a1db0a7f21843ed537d7 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Thu, 17 Mar 2022 13:13:41 +0100 Subject: [PATCH] lint: remove deprecated String.prototype.substr closes #459 --- lib/types/json.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/types/json.js b/lib/types/json.js index 2971dc14..9349cbd6 100644 --- a/lib/types/json.js +++ b/lib/types/json.js @@ -122,7 +122,7 @@ function json (options) { // assert charset per RFC 7159 sec 8.1 var charset = getCharset(req) || 'utf-8' - if (charset.substr(0, 4) !== 'utf-') { + if (charset.slice(0, 4) !== 'utf-') { debug('invalid charset') next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { charset: charset,