Multer: Update busboy to avoid deprecated Buffer API usage and drop support for Node.js 0.10 and 0.12

Created on 14 Jul 2020  路  1Comment  路  Source: expressjs/multer

Error

Full error message showed in stderr:

(node:5124) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    at showFlaggedDeprecation (buffer.js:174:11)
    at new Buffer (buffer.js:257:3)
    at Object.<anonymous> (/Users/my-project/node_modules/dicer/lib/HeaderParser.js:6:15)
    at Module._compile (internal/modules/cjs/loader.js:967:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1004:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)

Reason

As you can see, the error comes from dicer, the unique dependency of busboy.
Are there any blockers to update busboy to 0.3.x, version that includes the right Buffer.from syntax instead of new Buffer(). See following commit https://github.com/mscdex/busboy/commit/5777457431dbcd165c520d632c39d807cb6597a4

Solution

This previously opened PR would fix it:
https://github.com/expressjs/multer/pull/736

Its travis tests only fail on Node.js version 0.10 an 0.12 (https://travis-ci.org/github/expressjs/multer/builds/522381120) which have ended their life 4 years ago (2016-12-31). Even if https://github.com/expressjs/multer/issues/414 is underway, can we at least:

  • mark these two version as deprecated
  • remove them from travis tests
  • update busboy
  • publish a minor version

so the Buffer problem goes away?

Thanks

bug

Most helpful comment

Would be pretty nice to get rid of this warning!

>All comments

Would be pretty nice to get rid of this warning!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

edi picture edi  路  4Comments

Paul-Morris picture Paul-Morris  路  3Comments

kiwenlau picture kiwenlau  路  4Comments

samipjain picture samipjain  路  4Comments

bpetty-formfast picture bpetty-formfast  路  3Comments