Skip to content

Commit

Permalink
update: lib/json.js use const define len (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuler authored and haoxins committed Apr 16, 2019
1 parent db6041c commit a847bfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ module.exports = async function(req, opts) {
opts = utils.clone(opts);

// defaults
let len = req.headers['content-length'];
const len = req.headers['content-length'];
const encoding = req.headers['content-encoding'] || 'identity';
if (len && encoding === 'identity') opts.length = len = ~~len;
if (len && encoding === 'identity') opts.length = ~~len;
opts.encoding = opts.encoding || 'utf8';
opts.limit = opts.limit || '1mb';
const strict = opts.strict !== false;
Expand Down

0 comments on commit a847bfd

Please sign in to comment.