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 changes introduced in https://github.com/request/request/pull/1282 #1310
Conversation
For some reason this change brakes the form option when it's object
This is very bad, it turns out that the unit test doesn't catch the bug. |
The problem is that here In short with the current implementation we can support only non if (typeof self.body !== 'string') but that's just too magical. And of course we need a proper unit test for that combination of options before making any changes to that behavior. |
`form` is object, and `json` is set to `true` Example: {form: {some: 'url', encoded: 'data'}, json: true}
Added the missing test case. Now changing |
application/x-www-form-urlencoded requests as they have their body already stringified as url encoded string inside the `form` method
Revert changes introduced in #1282
I have not been following this issue very closely, so thank you for the support! Version |
Fixes #1309
Reverting back the changes introduced in #1282 more info here #1281
For some reason this change brakes the form option when it's object.See belowFrom the docs
No idea why it brakes yet, that's just the fix.I can confirm the bug by running my system tests in https://github.com/simov/purest/blob/master/test/request/post.js