authHeader() throws "TypeError: context.hasOwnProperty is not a function" when body is a query string
laurence-myers opened this issue · comments
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.