Commit Graph

439 Commits

Author SHA1 Message Date
Christian Kamm 2a2dffa882 Backport v3 handling of chunked transfer end
The v2 backport produced invalid errors in some situations.
2023-06-12 21:04:10 +02:00
Jimmy Wärting afb36f6c17
Revert "fix: handle bom in text and json (#1739)" (#1741)
This reverts commit 29909d75c6.
2023-05-09 13:05:46 +02:00
Alexis Clarembeau 29909d75c6
fix: handle bom in text and json (#1739)
* fix: handle bom in text and json
* add unit tests
2023-05-08 18:19:42 +02:00
Segev Finer 70f592d9d2
fix: "global is not defined" (#1704) 2023-01-30 22:59:17 +01:00
Amit Agarwal 0f1ebb0d9d
Prevent error when response is null (#1699)
Fix for this error.

TypeError: Cannot read properties of null (reading 'body')
2023-01-23 16:38:22 +01:00
Gregor Martynus 6e9464d7e3 ci(release): install dependencies 2023-01-12 17:02:06 -08:00
Gregor Martynus dd2a0ba0fb ci(release): install dependencies 2023-01-12 17:01:08 -08:00
Gregor Martynus 49bef02a2f ci(release): use latest Node LTS 2023-01-12 16:57:50 -08:00
Gregor Martynus ce37bcd93e ci(semantic-release): config 2023-01-12 16:56:34 -08:00
Gregor Martynus 1768eaa7dc ci(release): initial version 2023-01-12 16:55:10 -08:00
Val 8bb6e317c8
fix: prevent hoisting of the undefined `global` variable in `browser.js` (#1534)
Because of JS hoisting `var global` to the top of the file, `typeof
global` in `getGlobal()` will always be `undefined`.

By using a different variable name like `globalObject`, we are able to
read the "real" `typeof global` and get access to the global object that
way.
2022-11-08 13:46:25 +01:00
Seth Westphal e218f8d5b7
Add missing changelog entries. (#1613) 2022-07-31 17:01:53 +02:00
victal fddad0e7ea
fix(headers): don't forward secure headers on protocol change (#1605)
backport for #1599 to the 2.x branch

Co-authored-by: Guilherme Victal <guilherme.a@dasa.com.br>
2022-07-19 22:38:01 +02:00
Alex Potsides 50536d1e02
fix: premature close with chunked transfer encoding and for async iterators in Node 12 (#1172)
* fix: premature close with chunked transfer encoding and for async iterators in Node 12

This PR backports the fix from #1064 to the `2.x.x` branch following
the [comment here](https://github.com/node-fetch/node-fetch/pull/1064#issuecomment-849167400).

I had to add some extra babel config to allow using the `for await..of`
syntax in the tests.  The config is only needed for the tests as
this syntax is not used in the implementation.

* chore: fix up tests for node 6+

* chore: codecov dropped support for node < 8 without shipping major

* chore: npm7 strips empty dependencies hash during install

* chore: pin deps to versions that work on node 4

* chore: do not emit close error after aborting a request

* chore: test on node 4-16

* chore: simplify chunked transer encoding bad ending

* chore: avoid calling .destroy as it is not in every node.js release

* chore: listen for response close as socket is reused and shows warnings
2022-07-16 15:16:51 +02:00
Maciej Goszczycki 838d9713ef
Handle zero-length OK deflate responses (#903) 2022-01-17 00:40:12 +01:00
Jimmy Wärting 1ef4b560a1
backport of #1449 (#1453)
* backport of #1449

* bump patch version
2022-01-16 12:45:33 +01:00
Ciffelia 8fe5c4ea66
2.x: Specify encoding as an optional peer dependency in package.json (#1310)
* Specify `encoding` as an optional peer dependency

* Update package.json

Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>

Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
2021-11-05 14:42:53 +01:00
Jimmy Wärting f56b0c66d3
fix(URL): prefer built in URL version when available and fallback to whatwg (#1352)
* fix(URL): prefer built in URL version when available and fallback to whatwg

* bump minor
2021-10-31 16:40:17 +01:00
Linus Unnebäck b5417aea6a
fix: import whatwg-url in a way compatible with ESM Node (#1303)
* fix: import whatwg-url in a way compatible with ESM Node

* release: 2.6.5
2021-09-22 11:16:53 +02:00
Jimmy Wärting 18193c5922
fix v2.6.3 that did not sending query params (#1301) 2021-09-21 16:42:50 +02:00
Linus Unnebäck ace7536c95
fix: properly encode url with unicode characters (#1291)
* fix: properly encode url with unicode characters
* release: 2.6.3
2021-09-20 16:09:10 +02:00
Jimmy Wärting 152214ca2f
Fix(package.json): Corrected main file path in package.json (#1274)
* fix main configuration in package.json
* pinned a breaking change in codecov & teeny-request
2021-09-06 14:58:28 +02:00
Antoni Kepinski b5e2e41b2b
update version number 2020-09-05 14:58:33 +02:00
Antoni Kepinski 2358a6c256
Honor the `size` option after following a redirect and revert data uri support
Co-authored-by: Richie Bendall <richiebendall@gmail.com>
2020-09-05 14:55:39 +02:00
Sesamestrong 8c197f8982 docs: Fix typos and grammatical errors in README.md (#686) 2019-10-21 15:32:52 +13:00
Ramit Mittal 1e99050f94 fix: Change error message thrown with redirect mode set to error (#653)
The original error message does not provide enough information about what went wrong. It simply states a configuration setting.
2019-10-11 09:26:58 +13:00
Richie Bendall 244e6f63d4
docs: Show backers in README 2019-10-07 20:23:11 +13:00
dsuket 6a5d192034 fix: Properly parse meta tag when parameters are reversed (#682) 2019-10-07 19:58:27 +13:00
Richie Bendall 47a24a03eb
chore: Add opencollective badge 2019-10-02 22:00:55 +13:00
Richie Bendall 7b136627c5
chore: Add funding link 2019-10-02 21:50:00 +13:00
Boris Bosiljcic 5535c2ed47 fix: Check for global.fetch before binding it (#674) 2019-09-16 23:52:22 +12:00
Richie Bendall 1d5778ad0d
docs: Add Discord badge 2019-09-08 10:00:54 +12:00
Richie Bendall eb3a57255b
feat: Data URI support (#659)
Adds support for Data URIs using native methods in Node 5.10.0+
2019-09-08 09:44:40 +12:00
Steve Moser 086be6fc74 Remove --save option as it isn't required anymore (#581) 2019-08-09 11:17:25 +02:00
David Frank 95286f52bb
v2.6.0 (#638)
* Update readme and changelog for `options.agent`
- Fix content-length issue introduced in v2.5.0
* More test coverage for `extractContentType`
* Slightly improve test performance
* `Response.url` should not return null
* Document `Headers.raw()` usage better
* 2.6.0
2019-05-16 14:38:28 +08:00
edgraaff bf8b4e8db3 Allow agent option to be a function (#632)
Enable users to return HTTP/HTTPS-specific agent based on request url
2019-05-05 20:12:33 +08:00
David Frank 0c2294ec48
2.5.0 release (#630)
* redirected property
* changelog update
* readme update
* 2.5.0
2019-05-01 13:05:32 +08:00
David Frank 0fc414c2a8
Allow third party blob implementation (#629)
* Support making request with any blob that have stream() method
* don't clone blob when cloning request
* check for blob api that node-fetch uses
2019-05-01 11:44:27 +08:00
Justin Beckwith d8f5ba0e97 build: disable generation of package-lock since it is not used (#623) 2019-05-01 11:19:06 +08:00
Justin Beckwith 1fe1358642 test: enable --throw-deprecation for tests (#625) 2019-05-01 11:15:05 +08:00
Justin Beckwith a35dcd14a3 chore(deps): address deprecated url-search-params package (#622) 2019-05-01 11:14:11 +08:00
David Frank b3ecba5e81
2.4.1 release (#619)
* changelog update
* package.json update
2019-04-27 14:50:25 +08:00
mcuppi 1a88481fbd Fix Blob for older node versions and webpack. (#618)
`Readable` isn't a named export
2019-04-27 14:34:01 +08:00
David Frank c9805a2868
2.4.0 release (#616)
* changelog update
* package.json update
2019-04-27 01:20:20 +08:00
David Frank 49d77600a7
Pass custom timeout to subsequent requests on redirect (#615) 2019-04-27 00:46:53 +08:00
Andrew Leedham cfc8e5bad2 Swap packagephobia badge for flat style (#592) 2019-04-27 00:27:31 +08:00
Muhammet Öztürk 2a2d4384af Adding Brotli Support (#598)
* adding brotli support
* support old node versions
* better test
2019-04-27 00:20:15 +08:00
David Frank 05f5ac12a2
Node 12 compatibility (#614)
* 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
2019-04-27 00:11:52 +08:00
Jimmy Wärting 432c9b01ea support reading blob with stream (#608) 2019-04-16 18:29:17 +08:00
Jimmy Wärting 0ad136d49f Added new reading method to blob 2019-04-15 22:46:11 +02:00