Skip to content
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

authHeader() throws "TypeError: context.hasOwnProperty is not a function" when body is a query string #28

Open
laurence-myers opened this issue Jun 7, 2017 · 1 comment

Comments

@laurence-myers
Copy link

laurence-myers commented Jun 7, 2017

authHeader() -> prepareParameters() -> utils.extend()

prepareParameters() parses the body using "querystring"."parse()". utils.extend then attempts to call ".hasOwnProperty()" on the parsed querystring object. This property doesn't exist, due to missing prototype inheritance. The node.js documentation states:

Note: The object returned by the querystring.parse() method does not prototypically inherit from the JavaScript Object. This means that typical Object methods such as obj.toString(), obj.hasOwnProperty(), and others are not defined and will not work.

Tested on Node v6.9.1.

@jakezatecky
Copy link

Should already be resolved with #26, but that fix has not be published to npm yet. See #29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants