Skip to content

Commit 393efce

Browse files
refactor: replace deprecated String.prototype.substr() (#1066)
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <[email protected]> Co-authored-by: Daniel Lee <[email protected]>
1 parent b0140e4 commit 393efce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/providers/https.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ function isValidRequest(req: Request): req is HttpRequest {
437437
// If it has a charset, just ignore it for now.
438438
const semiColon = contentType.indexOf(';');
439439
if (semiColon >= 0) {
440-
contentType = contentType.substr(0, semiColon).trim();
440+
contentType = contentType.slice(0, semiColon).trim();
441441
}
442442
if (contentType !== 'application/json') {
443443
logger.warn('Request has incorrect Content-Type.', contentType);

0 commit comments

Comments
 (0)