-
-
Notifications
You must be signed in to change notification settings - Fork 933
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
Regression in 7.0.0 options processing #381
Comments
I can't reproduce that: isPlainObj(querystring.parse('x'));
//=> true |
@sindresorhus I've just checked it, and it seems that it was changed in Node 8, I'm sure this is edge case. And I think it's very illustrative of why it's may be not the best idea idea to provide breaking changes just because we can. I'm not the only user of Got, and there can be infinite amount of edge cases - I was notified of it by another user. People have to resort to |
I got the same result in latest Node.js 4 and 6 too. Regardless, we'll consider your request to change this. |
@sindresorhus I wonder how did you switch between versions. I have separate node executables for that, and I've got same results in runkit, https://runkit.com/sub/59d4947b71579b001199681e and https://runkit.com/sub/59d495ca735bd50012ba27bc . I'd expect it to be that way because that's what Node sources tell. |
I used |
Pull request welcome to loosen the restriction again, but should come with a test so it's not regressed in the future. |
#217 loosened unnecessary restrictions on
body
option that were discussed in #212 and allowed it to be an object that is generally considered plain by a developer, i.e. not a complex object - a buffer or a stream, which are processed differently.#297 introduced a regression that imposed a restriction on
body
option again.Excessive sanitization results from the use of
is-plain-obj
and restrictsbody
object prototype chain to contain onlyObject.prototype
ornull
. This restriction results in counter-intuitive behaviour and requires a developer to use tricks likeObject.assign({}, obj)
instead of not doing them, even if an object is perceived as 'plain' (in my experience it wasquerystring.parse()
) .More importantly, this results in breaking changes that aren't reflected in change logs. The restrictions were dropped for a good reason, and resulting behaviour has been already relied on by package users. Now the regression just happened without an obvious reason.
The text was updated successfully, but these errors were encountered: