diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ba41fa8..d6f11f77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +### 3.1.4 + + * fix: add missing pluginFailed error ([#794](https://github.com/node-formidable/formidable/pull/794)) + * refactor: use explicit node imports (#786) + ### 3.1.1 * feat: handle top level json array, string and number diff --git a/package.json b/package.json index aa745aa9..11d1064a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "formidable", - "version": "3.1.3", + "version": "3.1.4", "license": "MIT", "description": "A node.js module for parsing form data, especially file uploads.", "homepage": "https://github.com/node-formidable/formidable", diff --git a/src/Formidable.js b/src/Formidable.js index a823c281..6974361b 100644 --- a/src/Formidable.js +++ b/src/Formidable.js @@ -30,9 +30,10 @@ const DEFAULT_OPTIONS = { enabledPlugins: [octetstream, querystring, multipart, json], fileWriteStreamHandler: null, defaultInvalidName: 'invalid-name', - filter() { + filter(_part) { return true; }, + filename: undefined, }; function hasOwnProp(obj, key) { @@ -88,6 +89,8 @@ class IncomingForm extends EventEmitter { }); this._setUpMaxFields(); + this.ended = undefined; + this.type = undefined; } use(plugin) { diff --git a/src/FormidableError.js b/src/FormidableError.js index 7cbdb15c..ceb0508d 100644 --- a/src/FormidableError.js +++ b/src/FormidableError.js @@ -13,6 +13,7 @@ const missingContentType = 1011; const malformedMultipart = 1012; const missingMultipartBoundary = 1013; const unknownTransferEncoding = 1014; +const pluginFailed = 1017; const FormidableError = class extends Error { constructor(message, internalCode, httpCode = 500) { @@ -38,6 +39,7 @@ export { malformedMultipart, missingMultipartBoundary, unknownTransferEncoding, + pluginFailed, }; export default FormidableError;