Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing error #794

Merged
merged 3 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 4 additions & 1 deletion src/Formidable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -88,6 +89,8 @@ class IncomingForm extends EventEmitter {
});

this._setUpMaxFields();
this.ended = undefined;
this.type = undefined;
}

use(plugin) {
Expand Down
2 changes: 2 additions & 0 deletions src/FormidableError.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -38,6 +39,7 @@ export {
malformedMultipart,
missingMultipartBoundary,
unknownTransferEncoding,
pluginFailed,
};

export default FormidableError;