You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When formData is created by Object.create(null), the bug is triggered.
Ps: express req.body object is such objects.
constrequest=require('request');constformData=Object.create(null);formData.test='test';request.post({url: 'http://localhost:3000',formData: formData},function(err,res,body){if(err){returnconsole.error('upload failed:',err);}console.log('Upload successful! Server responded with:',body);});
$ node app.js
/Users/cik/Desktop/bug/node_modules/request/request.js:330
if (formData.hasOwnProperty(formKey)) {
^
TypeError: formData.hasOwnProperty is not a function
at Request.init (/Users/cik/Desktop/bug/node_modules/request/request.js:330:20)
at new Request (/Users/cik/Desktop/bug/node_modules/request/request.js:130:8)
at request (/Users/cik/Desktop/bug/node_modules/request/index.js:54:10)
at Function.post (/Users/cik/Desktop/bug/node_modules/request/index.js:62:12)
at Object.<anonymous> (/Users/cik/Desktop/bug/app.js:6:9)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
When formData is created by Object.create(null), the bug is triggered.
Ps: express req.body object is such objects.
The text was updated successfully, but these errors were encountered: