From 72ac275c77fbeea913c9d84439d1ffacee3f8b1e Mon Sep 17 00:00:00 2001 From: Cyril Walle Date: Tue, 30 Nov 2021 16:06:00 +0100 Subject: [PATCH 1/3] fix: add missing error --- src/FormidableError.js | 2 ++ 1 file changed, 2 insertions(+) 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; From fe012bf28f14f1bb6975ef83be601a56e68e090e Mon Sep 17 00:00:00 2001 From: Cyril Walle Date: Tue, 30 Nov 2021 16:17:03 +0100 Subject: [PATCH 2/3] refactor: be more explicit about object signature --- src/Formidable.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { From d27f650703b3087e6b4ab157b175dc668fd0d2f0 Mon Sep 17 00:00:00 2001 From: Cyril Walle Date: Tue, 30 Nov 2021 16:26:15 +0100 Subject: [PATCH 3/3] docs: changelog --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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",