Skip to content

utils.merge not considering/handling the prototype chain #1077

@rupesh1

Description

@rupesh1

#### Summary
Trying to use Axios on Node with your own http(s)Agent set via the global default triggers the error: TypeError: self.agent.addRequest is not a function

For minimal example see: https://runkit.com/rupesh/59b1bcc1efc2f800128b7d54

It seems to be related to utils.merge not considering/handling the prototype chain:
developer_tools_-_node_js

Stack trace:

TypeError: self.agent.addRequest is not a function
at new ClientRequest in core _http_client.js — line 160
at http.Agent in core http.js — line 31
at RedirectableRequest._performRequest in follow-redirects/index.js — line 73
at Writable.RedirectableRequest in follow-redirects/index.js — line 57
at wrappedProtocol.request in follow-redirects/index.js — line 229
at dispatchHttpRequest in axios/lib/adapters/http.js — line 131
at httpAdapter in axios/lib/adapters/http.js — line 18

#### Context

  • axios version: 0.16.2
  • Environment: node v4, 6, 7 and 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions