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
Content-Type is not set when using req.form() #1684
Comments
Thanks for the feedback @eddiezane, can you show me the relevant code on your end? #1650 should set the |
I can confirm this bug: And one with request@2.59.0: http://requestb.in/15c7kfd1?inspect |
Wow, ok, that's the bug request/caseless@93d11f0 in the latest version of caseless, @mikeal any background info on this change? Code to reproduce it (but I suspect that this potentially might have side effects in other places as well): var request = require('request')
request({
method: 'post',
url: "http://requestb.in/15c7kfd1",
formData: {
file: "something"
}
}, function(err, res, body) {
if (err) return console.error(err);
console.log(res.request.headers);
console.log(body)
}) |
Also seeing this bug as described, specifically in my case: var form = req.form();
form.append('file', fs.createReadStream('/path/to/file')); would attach the appropriate |
Thanks for the feedback everyone, the fix is pushed here #1687 and it will be published shortly (read today). |
2.60 is published. |
Thanks for working through this so quickly! |
It looks like v2.59.0 and #1650 broke the sendgrid library by making it so
Content-Type
is not set when usingreq.form()
. A refactor is probably in order on our end, but just wanted to share https://github.com/sendgrid/sendgrid-nodejs/issues/178.The text was updated successfully, but these errors were encountered: