We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc203ca commit 6035eb9Copy full SHA for 6035eb9
src/Formidable.js
@@ -202,8 +202,8 @@ class IncomingForm extends EventEmitter {
202
}
203
204
const callback = once(dezalgo(cb));
205
- this.fields = {};
206
- const files = {};
+ this.fields = Object.create(null);
+ const files = Object.create(null);
207
208
this.on('field', (name, value) => {
209
if (this.type === 'multipart' || this.type === 'urlencoded') {
src/plugins/json.js
@@ -27,7 +27,7 @@ function init(_self, _opts) {
27
const parser = new JSONParser(this.options);
28
29
parser.on('data', (fields) => {
30
- this.fields = fields;
+ this.fields = Object.assign(Object.create(null), fields);
31
});
32
33
parser.once('end', () => {
0 commit comments