* dev package bump
* test invalid header differently as node 12 no longer accepts invalid headers in response
* add node v10 in travis test list as node 12 has been released
* fix import rule for stream PassThrough
* avoid named export for compatibility below node 10
* compress flag should not overwrite accept encoding header
* doc update
* 2.2.1
- Handle Location-less redirect like non-redirect response.
- Include bodies when redirecting to non-POST 301/302 and all 307/308
response.
Co-authored-by: Gregor Martynus <[email protected]>
- 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]>
* remove `encoding` as a dependency, throw descriptive Error if textConverted() is used without it in env
* remove rollup ext dep resolution since we don't need it
* switch to programmer error, rm unneeded test conditions, bump timeout for slow CI
* more kill `encoding` dep PR changes
keep blank "dependencies" prop in package.json so rollup's external config func doesn't seize
add ext dep checks back to the rollup config
no implicit var
clarify test comment
* [squash] alter travis cfg to test with and without `encoding`, various
fix devDeps
separate `encoding` tests to their own block
* [squash] fixing nits
* [squash] ci: full matrix of form-data versions and encoding existence
and nits
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.
The `.stack` property gets cached in the `captureStackTrace()` call, so
whatever is set as the `name` and `message` at that time will be used
for the first line of the stack trace.
Before this patch, FetchError's stack would just say "Error" as the
first line. Now they correctly display the "${name}: ${message}" of the
error instances.
Test case included.
Signed-off-by: Timothy Gu <[email protected]>