- Make read-only attributes actually read-only
- Set @@toStringTag on the prototype only
- Make prototype methods/getters enumerable
Based on #354.
Co-authored-by: Benjamin Seber <[email protected]>
This reverts commit ec29e3d264.
This patch prevents any agent being passed in which is not explicitly
an instance of `http.Agent`. This makes `node-fetch` no longer
compatible with https://npm.im/proxy-agent, which is one example of a
library that does not directly inherit from `http.Agent` directly.
Sorry for the revert -- I don't have an alternative patch because I
don't believe this is something node-fetch should be doing
automatically, because of how much of a limitation this could impose.
The original PR stated that this was to prevent requiring http/https,
and the effect would effectively be to force creation of an Agent on
every call. Note that this is already the behavior specified for
http.Agent when http.request received `false`. (See the bottom of the
[section on http.Agent in the Node
docs](https://nodejs.org/dist/latest-v7.x/docs/api/http.html#http_class_http_agent).
Cheers, and with apologies to @ahmadnassri for reverting their PR.