Skip to content

Commit

Permalink
lint: remove deprecated String.prototype.substr
Browse files Browse the repository at this point in the history
closes #459
  • Loading branch information
CommanderRoot authored and dougwilson committed Mar 20, 2022
1 parent 96df60f commit bd702d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/types/json.js
Expand Up @@ -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,
Expand Down

0 comments on commit bd702d2

Please sign in to comment.