maticzav / semantha

šŸ’ā€ā™€ļø A delightful mono-repository assistant.
MIT License
2 stars 0 forks source link

Update dependency got to v11 [SECURITY] #87

Open renovate[bot] opened 2 years ago

renovate[bot] commented 2 years ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
got 9.6.0 -> 11.8.5 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2022-33987

The got package before 11.8.5 and 12.1.0 for Node.js allows a redirect to a UNIX socket.


Release Notes

sindresorhus/got ### [`v11.8.5`](https://togithub.com/sindresorhus/got/releases/tag/v11.8.5) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.8.3...v11.8.5) - Backport security fix https://github.com/sindresorhus/got/commit/861ccd9ac2237df762a9e2beed7edd88c60782dc - [CVE-2022-33987](https://nvd.nist.gov/vuln/detail/CVE-2022-33987) ### [`v11.8.3`](https://togithub.com/sindresorhus/got/releases/tag/v11.8.3) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.8.2...v11.8.3) - Bump cacheable-request dependency ([#​1921](https://togithub.com/sindresorhus/got/issues/1921)) [`9463bb6`](https://togithub.com/sindresorhus/got/commit/9463bb6) - Fix `HTTPError` missing `.code` property ([#​1739](https://togithub.com/sindresorhus/got/issues/1739)) [`0e167b8`](https://togithub.com/sindresorhus/got/commit/0e167b8) ### [`v11.8.2`](https://togithub.com/sindresorhus/got/releases/tag/v11.8.2) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.8.1...v11.8.2) - Make the `dnsCache` option lazy ([#​1529](https://togithub.com/sindresorhus/got/issues/1529)) [`3bd245f`](https://togithub.com/sindresorhus/got/commit/3bd245f) This slightly improves Got startup performance and fixes an issue with Jest. ### [`v11.8.1`](https://togithub.com/sindresorhus/got/releases/tag/v11.8.1) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.8.0...v11.8.1) - Do not throw on custom stack traces ([#​1491](https://togithub.com/sindresorhus/got/issues/1491)) [`4c815c3`](https://togithub.com/sindresorhus/got/commit/4c815c3a609eb74d0eb139414d9996b4f65dc3c0) ### [`v11.8.0`](https://togithub.com/sindresorhus/got/releases/tag/v11.8.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.7.0...v11.8.0) - Fix for sending files with size `0` on `stat` ([#​1488](https://togithub.com/sindresorhus/got/issues/1488)) [`7acd380`](https://togithub.com/sindresorhus/got/commit/7acd380) - `beforeRetry` allows stream body if different from original ([#​1501](https://togithub.com/sindresorhus/got/issues/1501)) [`3dd2273`](https://togithub.com/sindresorhus/got/commit/3dd2273) - Set default value for an options object ([#​1495](https://togithub.com/sindresorhus/got/issues/1495)) [`390b145`](https://togithub.com/sindresorhus/got/commit/390b145) ### [`v11.7.0`](https://togithub.com/sindresorhus/got/releases/tag/v11.7.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.6.2...v11.7.0) ##### Improvements - Add [`pfx`](https://togithub.com/sindresorhus/got#httpspfx) HTTPS option ([#​1364](https://togithub.com/sindresorhus/got/issues/1364)) [`c33df7f`](https://togithub.com/sindresorhus/got/commit/c33df7f) - Update `body` after `beforeRequest` ([#​1453](https://togithub.com/sindresorhus/got/issues/1453)) [`e1c1844`](https://togithub.com/sindresorhus/got/commit/e1c1844) - Don't allocate buffer twice ([#​1403](https://togithub.com/sindresorhus/got/issues/1403)) [`7bc69d9`](https://togithub.com/sindresorhus/got/commit/7bc69d9) ##### Fixes - Fix a regression where body was sent after redirect [`88b32ea`](https://togithub.com/sindresorhus/got/commit/88b32ea) - Fix destructure error on `promise.json()` [`c97ce7c`](https://togithub.com/sindresorhus/got/commit/c97ce7c) - Do not ignore userinfo on a redirect to the same origin [`52de13b`](https://togithub.com/sindresorhus/got/commit/52de13b) ### [`v11.6.2`](https://togithub.com/sindresorhus/got/releases/tag/v11.6.2) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.6.1...v11.6.2) ##### Bug fixes - Inherit the `prefixUrl` option from parent if it's `undefined` ([#​1448](https://togithub.com/sindresorhus/got/issues/1448)) [`a3da70a`](https://togithub.com/sindresorhus/got/commit/a3da70a78aeb7f44dd3e0d0fa47cebe9541eb91e) - Prepare a fix for hanging promise on Node.js 14.10.x [`29d4e32`](https://togithub.com/sindresorhus/got/commit/29d4e325b110ccf7571d4265d40760be4175f7ff) - Prepare for Node.js 15.0.0 [`c126ff1`](https://togithub.com/sindresorhus/got/commit/c126ff19c4e893975cbf6c2c8bebce6ed7631276) ##### Docs - Point travis-ci.org badge to travis-ci.com ([#​1442](https://togithub.com/sindresorhus/got/issues/1442)) [`2b352d3`](https://togithub.com/sindresorhus/got/commit/2b352d3f9e216e116efc0249a3a78b8d4492f97c) - Clarify the retry mechanism [`f248618`](https://togithub.com/sindresorhus/got/commit/f2486180207dba30624901761a457694096441c1) - Fix `RequestError` links [`3ed4af6`](https://togithub.com/sindresorhus/got/commit/3ed4af605ca6493c080cc8003a55c3b37988efee) ##### Tests - Downgrade Travis CI Node.js version to 14.9.0 ([#​1454](https://togithub.com/sindresorhus/got/issues/1454)) [`27470b5`](https://togithub.com/sindresorhus/got/commit/27470b53e1bcd6f435fc77006c9e3e864961dbec) ### [`v11.6.1`](https://togithub.com/sindresorhus/got/releases/tag/v11.6.1) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.6.0...v11.6.1) ##### Fixes - Fix `options.port` on redirect ([#​1439](https://togithub.com/sindresorhus/got/issues/1439)) [`408e22a`](https://togithub.com/sindresorhus/got/commit/408e22a) ##### Meta - Welcome [@​Giotino](https://togithub.com/Giotino) as a maintainer šŸŽ‰ [`5031843`](https://togithub.com/sindresorhus/got/commit/5031843) - Showcase companies using Got ([#​1432](https://togithub.com/sindresorhus/got/issues/1432)) [`d12d6af`](https://togithub.com/sindresorhus/got/commit/d12d6af) ### [`v11.6.0`](https://togithub.com/sindresorhus/got/releases/tag/v11.6.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.5.2...v11.6.0) ##### Improvements - Add `retry` stream event ([#​1384](https://togithub.com/sindresorhus/got/issues/1384)) [`7072198`](https://togithub.com/sindresorhus/got/commit/707219825b2f8ff3df597230a53244636df21642) - Add types for `http-cache-semantics` options [`2e2295f`](https://togithub.com/sindresorhus/got/commit/2e2295fba63c260d347fef2081cdbcae45fa6116) - Make `CancelError` inherit `RequestError` [`1f132e8`](https://togithub.com/sindresorhus/got/commit/1f132e88b4e9b295631637757d64307032a4e56e) - Add `retryAfter` to `RetryObject` [`643a305`](https://togithub.com/sindresorhus/got/commit/643a305b4d710042d2a958a21e7637183713505c) - Add documentation comments to exported TypeScript types ([#​1278](https://togithub.com/sindresorhus/got/issues/1278)) [`eaf1e02`](https://togithub.com/sindresorhus/got/commit/eaf1e02b21e4b8c08197c6400844d4098828ecf4) - Move cache options into a `cacheOptions` property [`9c16d90`](https://togithub.com/sindresorhus/got/commit/9c16d9083019fcb28f566659106036faa4839447) ##### Bug fixes - Got promise shouldn't retry when the body is a stream [`6e1aeae`](https://togithub.com/sindresorhus/got/commit/6e1aeaedb5dfe4f4b15eecf72a80303c30df22af) ##### Docs - Add an example of nock integration with retrying [`f7bbc37`](https://togithub.com/sindresorhus/got/commit/f7bbc3753779e14b22d7aa337764c7048aebb915) - Fix `CancelError` docs [`28c400f`](https://togithub.com/sindresorhus/got/commit/28c400f4df5f45990f80641a794a2d09439bef93) - Fix retry delay function in the `README` ([#​1425](https://togithub.com/sindresorhus/got/issues/1425)) [`38bbb04`](https://togithub.com/sindresorhus/got/commit/38bbb04ea24f01eed6f01e394bc3e9405df8cfc5) ### [`v11.5.2`](https://togithub.com/sindresorhus/got/releases/tag/v11.5.2) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.5.1...v11.5.2) ##### Docs - Add hpagent to proxy section ([#​1363](https://togithub.com/sindresorhus/got/issues/1363)) [`a3e171c`](https://togithub.com/sindresorhus/got/commit/a3e171c4d43c8bbb236ef3a04feb25ba6fdf6c49) - Mention header lowercasing in`request` migration guide ([#​1387](https://togithub.com/sindresorhus/got/issues/1387)) [`a748343`](https://togithub.com/sindresorhus/got/commit/a748343363ecb0347897264fb49df4a8f4793997) - Fixed deprecationWarning on https options ([#​1391](https://togithub.com/sindresorhus/got/issues/1391)) [`9a309bd`](https://togithub.com/sindresorhus/got/commit/9a309bdbe7e2552c5bffbea253d58c39d6e6c3e3) ##### Bug fixes - Fix duplicated hooks when paginating [`e02845f`](https://togithub.com/sindresorhus/got/commit/e02845f1aa737d55dce23381d0f4f2a61b1eb5e1) - Fix `dnsCache: true` having no effect [`043c950`](https://togithub.com/sindresorhus/got/commit/043c9501b85172e09819d44ac8eb49c574b27bda) ### [`v11.5.1`](https://togithub.com/sindresorhus/got/releases/tag/v11.5.1) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.5.0...v11.5.1) ##### Enhancements - Upgrade `http2-wrapper` to `1.0.0-beta.5.0` [`16e7f03`](https://togithub.com/sindresorhus/got/commit/16e7f031bb371571e1948091b88385be3485d83f) - Compatibility fix to ignore incorrect Node.js 12 typings [`f7a1379`](https://togithub.com/sindresorhus/got/commit/f7a1379e417641613bf1b654e37f37a7e6447e0c) [`61d6f61`](https://togithub.com/sindresorhus/got/commit/61d6f610ffa6b760d466ff910a8e959778ee36e0) ##### Bug fixes - Prevent uncaught errors on HTTP errors [`2d96679`](https://togithub.com/sindresorhus/got/commit/2d96679c0a007be657835e83c6afb20b4510e9c5) [`1ef053d`](https://togithub.com/sindresorhus/got/commit/1ef053d2af7f9b050ce0a3d1884f45b285f2e775) ##### Docs - Mention HTTP/2 proxying in `readme.md` [`4ebd26a`](https://togithub.com/sindresorhus/got/commit/4ebd26a4b8eef704fe216d333e2614b39dedf695) - Update the comparison table [`bd2d532`](https://togithub.com/sindresorhus/got/commit/bd2d53269882e48af88ff736a2e82aecd9e1fbee) [`c833939`](https://togithub.com/sindresorhus/got/commit/c83393933c2b308a312ed4dc85d852c79445e400) - Document the hierarchy of error classes ([#​1359](https://togithub.com/sindresorhus/got/issues/1359)) [`559526e`](https://togithub.com/sindresorhus/got/commit/559526ee273fb60d152759d288bc76971abb99e2) - Fix example code for HTTPS proxy ([#​1360](https://togithub.com/sindresorhus/got/issues/1360)) [`4083347`](https://togithub.com/sindresorhus/got/commit/408334756ace0570ca4a0aded5a8aeac437eac33) ### [`v11.5.0`](https://togithub.com/sindresorhus/got/releases/tag/v11.5.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.4.0...v11.5.0) ##### Improvements - Add `backoff` option to pagination ([#​1182](https://togithub.com/sindresorhus/got/issues/1182)) [`4be7446`](https://togithub.com/sindresorhus/got/commit/4be7446) - Upgrade dependencies ([#​1345](https://togithub.com/sindresorhus/got/issues/1345)) [`b9a855d`](https://togithub.com/sindresorhus/got/commit/b9a855d) [`476c026`](https://togithub.com/sindresorhus/got/commit/476c026) [`8d697bc`](https://togithub.com/sindresorhus/got/commit/8d697bc) - Upgrade to TypeScript 3.9 ([#​1267](https://togithub.com/sindresorhus/got/issues/1267)) [`b51d836`](https://togithub.com/sindresorhus/got/commit/b51d836) ##### Fixes - Fix TypeScript types for Promise API ([#​1344](https://togithub.com/sindresorhus/got/issues/1344)) [`676be6d`](https://togithub.com/sindresorhus/got/commit/676be6d) - Fix cache not working with HTTP2 [`ac5f67d`](https://togithub.com/sindresorhus/got/commit/ac5f67d) - Fix `response` event not being emitted on cache verify request ([#​1305](https://togithub.com/sindresorhus/got/issues/1305)) [`da4769e`](https://togithub.com/sindresorhus/got/commit/da4769e) - Work around a bug in Node.js <=12.18.2 [`f33e8bc`](https://togithub.com/sindresorhus/got/commit/f33e8bc) - Remove request error handler after response is downloaded [`e1afe82`](https://togithub.com/sindresorhus/got/commit/e1afe82) - Revert "Remove request error handler after response is downloaded" [`aeb2e07`](https://togithub.com/sindresorhus/got/commit/aeb2e07) ##### Docs - Mention advanced usage of a `beforeRequest` hook [`779062a`](https://togithub.com/sindresorhus/got/commit/779062a) - Mention to end the stream if there's no body [`044767e`](https://togithub.com/sindresorhus/got/commit/044767e) ### [`v11.4.0`](https://togithub.com/sindresorhus/got/releases/tag/v11.4.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.3.0...v11.4.0) - Fix hanging promise on timeout on HTTP error [`934211f`](https://togithub.com/sindresorhus/got/commit/934211f951bfd56751e90ec4eabe6379d8541a05) - Use async iterators to get response body ([#​1256](https://togithub.com/sindresorhus/got/issues/1256)) [`7dcd145`](https://togithub.com/sindresorhus/got/commit/7dcd1456a68a2603d30cbb1a4e453c4560bd51b2) - Fix promise not returning Buffer on compressed response [`5028c11`](https://togithub.com/sindresorhus/got/commit/5028c11abd21c9d13bb3b12abb02961ec0465a8a) - Clarify options.encoding docs [`04f3ea4`](https://togithub.com/sindresorhus/got/commit/04f3ea4b7995e1609555dd13f00641b8f470de4c) - Fix unhandled `The server aborted pending request` rejection [`728aef9`](https://togithub.com/sindresorhus/got/commit/728aef989c1a6650d2b42a7f69b603075b5d35bf) - Add missing `ECONNRESET` code to an abort error [`d325d35`](https://togithub.com/sindresorhus/got/commit/d325d353a28e6038140aa5b18f2b6f9f796f10b6) - Fix `prefixUrl` not working when the `url` argument is empty [`8d3412a`](https://togithub.com/sindresorhus/got/commit/8d3412abb8aae3cefc75dd6f9e698988ed463dd6) - Improve the `searchParams` option [`4dbada9`](https://togithub.com/sindresorhus/got/commit/4dbada94e261ad890d2478c313ec3d74761b659e) - Fix non-enumerable options \[such as body] not being used [`8f775c7`](https://togithub.com/sindresorhus/got/commit/8f775c71c41a377186c6b38c6789542bfd523039) ### [`v11.3.0`](https://togithub.com/sindresorhus/got/releases/tag/v11.3.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.2.0...v11.3.0) - Deep merge `https` options ([#​1304](https://togithub.com/sindresorhus/got/issues/1304)) [`c98f0d7`](https://togithub.com/sindresorhus/got/commit/c98f0d7) - Add options to customize [parsing/stringifying JSON](https://togithub.com/sindresorhus/got#parsejson) ([#​1298](https://togithub.com/sindresorhus/got/issues/1298)) [`cb4da8d`](https://togithub.com/sindresorhus/got/commit/cb4da8d) - Add [`dnsLookupIpVersion`](https://togithub.com/sindresorhus/got#dnslookupipversion) option ([#​1264](https://togithub.com/sindresorhus/got/issues/1264)) [`7f643bb`](https://togithub.com/sindresorhus/got/commit/7f643bb) ### [`v11.2.0`](https://togithub.com/sindresorhus/got/releases/tag/v11.2.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.1.4...v11.2.0) - Provide an overload for unknown `responseType` ([#​1276](https://togithub.com/sindresorhus/got/issues/1276)) [`b9ba18a`](https://togithub.com/sindresorhus/got/commit/b9ba18a) - Fix overriding some options in a `beforeRequest` hook ([#​1293](https://togithub.com/sindresorhus/got/issues/1293)) [`d8c00cf`](https://togithub.com/sindresorhus/got/commit/d8c00cf) - Fix hanging promise on aborted requests on Node v14.3.0 ([#​1296](https://togithub.com/sindresorhus/got/issues/1296)) [`2ccc4c2`](https://togithub.com/sindresorhus/got/commit/2ccc4c2) - Do not wait for `ready` event if the file descriptor is already opened ([#​1289](https://togithub.com/sindresorhus/got/issues/1289)) [`2c8fe19`](https://togithub.com/sindresorhus/got/commit/2c8fe19) - General improvements to HTTPS API ([#​1255](https://togithub.com/sindresorhus/got/issues/1255)) [`697de37`](https://togithub.com/sindresorhus/got/commit/697de37) ### [`v11.1.4`](https://togithub.com/sindresorhus/got/releases/tag/v11.1.4) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.1.3...v11.1.4) - Clarify docs for got.HTTPError ([#​1244](https://togithub.com/sindresorhus/got/issues/1244)) [`3f125f1`](https://togithub.com/sindresorhus/got/commit/3f125f105e3b328942c04ef73579b1573fc39b5a) - Upgrade `cacheable-lookup` to 5.0.3 [`9770e54`](https://togithub.com/sindresorhus/got/commit/9770e540d088c35ec0b467fa3d2fafb60ed6797d) - Add a Runkit example ([#​1253](https://togithub.com/sindresorhus/got/issues/1253)) [`48bbb36`](https://togithub.com/sindresorhus/got/commit/48bbb369d715b8ec3c36e0af1ec88f47e2299172) - Mention `options.rejectUnauthorized` in the documentation [`9b04963`](https://togithub.com/sindresorhus/got/commit/9b049635570ebbdd9d534ad1860f01d34771a5ee) - Test `responseType` set to `undefined` [`0e8582f`](https://togithub.com/sindresorhus/got/commit/0e8582f24e6903d9079a7d92e9b4d831cb5b5f17) - Slightly improve RunKit example [`6f84051`](https://togithub.com/sindresorhus/got/commit/6f8405102517a1e61393ee7bdb5a4fcff08e64c5) - Make `got.paginate()` an alias for `got.paginate.each()` [`5480b31`](https://togithub.com/sindresorhus/got/commit/5480b3134cfd35497f618f08f574927c2bd7624b) - Don't force query string normalization ([#​1246](https://togithub.com/sindresorhus/got/issues/1246)) [`761b8e0`](https://togithub.com/sindresorhus/got/commit/761b8e01f7d194dd3b9aa6578c26966ebae6172c) - Upgrade `decompress-response` to `6.0.0` [`c2bc014`](https://togithub.com/sindresorhus/got/commit/c2bc014abc8818ad93dd69a0e8cc9d36d0dccb9c) - Migrate from `lolex` to `@sinonjs/fake-timers` ([#​1270](https://togithub.com/sindresorhus/got/issues/1270)) [`df333dd`](https://togithub.com/sindresorhus/got/commit/df333ddbc163e35537a9f49818e722c7aa6803c0) - Make `calculateDelay` promisable ([#​1266](https://togithub.com/sindresorhus/got/issues/1266)) [`3745efc`](https://togithub.com/sindresorhus/got/commit/3745efc9d9d03c78c898f357a34524524cce514d) ### [`v11.1.3`](https://togithub.com/sindresorhus/got/releases/tag/v11.1.3) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.1.2...v11.1.3) - Do not use deprecated `request.abort()` ([#​1242](https://togithub.com/sindresorhus/got/issues/1242)) [`ab338a7`](https://togithub.com/sindresorhus/got/commit/ab338a70dd9547a6c48af18ab5e2306639e5cbad) - Remove the `host` header on redirect ([#​1241](https://togithub.com/sindresorhus/got/issues/1241)) [`8ff71d9`](https://togithub.com/sindresorhus/got/commit/8ff71d972ae55700887b45d50a265e3659ac8cce) - Prevent URL pollution ([#​1243](https://togithub.com/sindresorhus/got/issues/1243)) [`7dbb9ee`](https://togithub.com/sindresorhus/got/commit/7dbb9ee2bd58e8ee67ebfe734e0c62e765759593) - Fix duplicated searchParams for pagination API ([#​1229](https://togithub.com/sindresorhus/got/issues/1229)) [`91aa0ac`](https://togithub.com/sindresorhus/got/commit/91aa0ac9e676130cd4cfc1183d16208c6167b31d) - Add a test for stringified `searchParams` in merge ([#​1208](https://togithub.com/sindresorhus/got/issues/1208)) [`7d7361c`](https://togithub.com/sindresorhus/got/commit/7d7361cc3845421f24288fc39464a8b38bd75d56) - Fix reusing options when paginating [`8862270`](https://togithub.com/sindresorhus/got/commit/88622701c70434ddc1040c46ad16de0c0acd9143) - Fix an invalid pagination test [`47c1afe`](https://togithub.com/sindresorhus/got/commit/47c1afedc77b27a2eb3edd85064d8532da835045) [`5131dc2`](https://togithub.com/sindresorhus/got/commit/5131dc2778a9b584acda062635a9458d5b22df0c) ### [`v11.1.2`](https://togithub.com/sindresorhus/got/releases/tag/v11.1.2) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.1.1...v11.1.2) ##### Bug fixes - Disable `options.dnsCache` by default [`79507c2`](https://togithub.com/sindresorhus/got/commit/79507c2cdec137e65d715f36d13a5a0e577ddc01) > This should stay disabled when making requests to internal hostnames such as localhost, database.local etc. > CacheableLookup uses dns.resolver4(..) and dns.resolver6(...) under the hood and fall backs to dns.lookup(...) when the first two fail, which may lead to additional delay. ##### Enhancements - Add test cases for issues [#​1221](https://togithub.com/sindresorhus/got/issues/1221) and [#​1223](https://togithub.com/sindresorhus/got/issues/1223) ([#​1231](https://togithub.com/sindresorhus/got/issues/1231)) [`822bfa7`](https://togithub.com/sindresorhus/got/commit/822bfa770306737a3ad06196101975b669b5d738) - Update dependencies [`05ff878`](https://togithub.com/sindresorhus/got/commit/05ff8780768d48fb58c782ba0b9c141af44a7c15) ### [`v11.1.1`](https://togithub.com/sindresorhus/got/releases/tag/v11.1.1) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.1.0...v11.1.1) - Improve Node.js 14 compatibility [`50ef99a`](https://togithub.com/sindresorhus/got/commit/50ef99a) - Fix `got.mergeOptions()` regression [`157e02b`](https://togithub.com/sindresorhus/got/commit/157e02b) - Fix hanging promise when using cache [`7b19e8f`](https://togithub.com/sindresorhus/got/commit/7b19e8f) - Make `options.responseType` optional when using a template [`9ed0a39`](https://togithub.com/sindresorhus/got/commit/9ed0a39) ### [`v11.1.0`](https://togithub.com/sindresorhus/got/releases/tag/v11.1.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.0.3...v11.1.0) - Add [`pagination.stackAllItems`](https://togithub.com/sindresorhus/got#paginationstackallitems) option ([#​1214](https://togithub.com/sindresorhus/got/issues/1214)) [`c1208d1`](https://togithub.com/sindresorhus/got/commit/c1208d1) - Allow response body to be typed for pagination API ([#​1212](https://togithub.com/sindresorhus/got/issues/1212)) [`c127f5b`](https://togithub.com/sindresorhus/got/commit/c127f5b) - Fix some options not working with the pagination API [`278c421`](https://togithub.com/sindresorhus/got/commit/278c421) ### [`v11.0.3`](https://togithub.com/sindresorhus/got/releases/tag/v11.0.3) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.0.2...v11.0.3) ##### Fixes - Limit number of requests in pagination to prevent accidental overflows ([#​1181](https://togithub.com/sindresorhus/got/issues/1181)) [`4344c3a`](https://togithub.com/sindresorhus/got/commit/4344c3a) - Fix promise rejecting before retry [`b927e2d`](https://togithub.com/sindresorhus/got/commit/b927e2d) - Fix `options.searchParams` duplicates [`429db40`](https://togithub.com/sindresorhus/got/commit/429db40) - Prevent calling `.abort()` on a destroyed request [`63c1b72`](https://togithub.com/sindresorhus/got/commit/63c1b72) ##### Docs - Fix incorrect usage in the readme examples ([#​1203](https://togithub.com/sindresorhus/got/issues/1203)) [`16ff82f`](https://togithub.com/sindresorhus/got/commit/16ff82f) - Note that `cache` and `dnsCache` can be `false` [`7c5290d`](https://togithub.com/sindresorhus/got/commit/7c5290d) ### [`v11.0.2`](https://togithub.com/sindresorhus/got/releases/tag/v11.0.2) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.0.1...v11.0.2) - Fix `response.statusMessage` being null [`965bd03`](https://togithub.com/sindresorhus/got/commit/965bd03ad463afb9fdbe098a48b16269b54de9bd) - Update the `http2-wrapper` dependency to `1.0.0-beta.4.4` [`4e8de8e`](https://togithub.com/sindresorhus/got/commit/4e8de8e32cccaafddf0c6ef4f31716810ab4a14b) - Use `Merge` as it's stricter than the intersection operator [`d3b972e`](https://togithub.com/sindresorhus/got/commit/d3b972efaca28d8033468c7232a469e8cb034677) - Prevent silent rejections in rare cases [`8501c69`](https://togithub.com/sindresorhus/got/commit/8501c6901af4f7c74cd0ae3700b499bb42ce5928) - Do not alter `options.body` [`835c70b`](https://togithub.com/sindresorhus/got/commit/835c70bd6fdc5b1ba7e7ffd322490b6d66fb407e) ### [`v11.0.1`](https://togithub.com/sindresorhus/got/releases/tag/v11.0.1) [Compare Source](https://togithub.com/sindresorhus/got/compare/v11.0.0...v11.0.1) Fixed two regressions: - `HTTPError`s have unspecified response body ([#​1162](https://togithub.com/sindresorhus/got/issues/1162)) - Options are duplicated while merging ([#​1163](https://togithub.com/sindresorhus/got/issues/1163)) [Improved TypeScript types for errors inherited from `RequestError`](https://togithub.com/sindresorhus/got/commit/d914a7e7a0d97b03745b9b47623e4ac3532b4dae#diff-8eef38c70c64f535c3b8046b5ce40d9e) ### [`v11.0.0`](https://togithub.com/sindresorhus/got/releases/tag/v11.0.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.7.0...v11.0.0) Introducing Got 11! :tada: The last major version was in December last year. :snowflake: Since then, a huge amount of bugs has been fixed. There are also many new features, for example, **HTTP2 support** is finally live! :globe_with_meridians: *If you find Got useful, you might want to [sponsor the Got maintainers](https://togithub.com/sindresorhus/got?sponsor=1).* *** ##### Breaking changes ##### Removed support for `electron.net` Due to the inconsistencies between the Electron's `net` module and the Node.js `http` module, we have decided to officially drop support for it. Therefore, the `useElectronNet` option has been removed. You'll still be able to use Got in the Electron main process and in the renderer process through the `electron.remote` module or if you use Node.js shims. ##### The Pagination API is now stable We haven't seen any bugs yet, so please give it a try! If you want to leave some feedback, you can do it [here](https://togithub.com/sindresorhus/got/issues/1052). Any suggestion is greatly appreciated! ```diff { - _pagination: {...} + pagination: {...} } ``` ##### API - The `options.encoding` behavior has been reverted back to the Got 9 behavior. In other words, the options is only meant for the Got promise API. To set the encoding for streams, simply call `stream.setEncoding(encoding)`. ```diff -got.stream('https://sindresorhus.com', {encoding: 'base64'}); +got.stream('https://sindresorhus.com').setEncoding('base64'); // Promises stay untouched await got('https://sindresorhus.com', {encoding: 'base64'}); ``` - The error name `GotError` has been renamed to `RequestError` for better readability and to comply with the documentation. ```diff -const {GotError} = require('got'); +const {RequestError} = require('got'); ``` - The `agent` option now accepts **only an object** with `http`, `https` and `http2` properties. While the `http` and `https` properties accept native `http(s).Agent` instances, the `http2` property must be an instance of [`http2wrapper.Agent`](https://togithub.com/szmarczak/http2-wrapper#new-http2agentoptions) or be undefined. ```diff { - agent: new https.Agent({keepAlive: true}) } { + agent: { + http: new http.Agent({keepAlive: true}), + https: new https.Agent({keepAlive: true}), + http2: new http2wrapper.Agent() + } } ``` - The `dnsCache` option is now set to a default instance of [`CacheableLookup`](https://togithub.com/szmarczak/cacheable-lookup). It cannot be a `Map`-like instance anymore. The underlying [`cacheable-lookup`](https://togithub.com/szmarczak/cacheable-lookup) package has received many improvements, for example, it has received `hosts` file support! Additionally, the `cacheAdapter` option has been renamed to `cache`. Note that it's no longer passed to [Keyv](https://togithub.com/lukechilds/keyv), so you need to pass a Keyv instance it if you want to save the data for later. ```diff { - dnsCache: new CacheableLookup({ - cacheAdapter: new Map() - }) } { + dnsCache: new CacheableLookup({ + cache: new Keyv({ + cacheAdapter: new Map() + }) + }) } // Default: { dnsCache: new CacheableLookup() } ``` - Errors thrown in `init` hooks will be converted to instances of `RequestError`. `RequestError`s provide much more useful information, for example, you can access the Got options (through `error.options`), which is very useful when debugging. ```js const got = require('got'); (async () => { try { await got('https://sindresorhus.com', { hooks: { init: [ options => { if (!options.context) { throw new Error('You need to pass a `context` option'); } } ] } }); } catch (error) { console.log(`Request failed: ${error.message}`); console.log('Here are the options:', error.options); } })(); ``` - The options passed in an `init` hook may not have a `url` property. To modify the request URL you should use a `beforeRequest` hook instead. ```diff { hooks: { - init: [ + beforeRequest: [ options => { options.url = 'https://sindresorhus.com'; } ] } } ``` Note that this example shows a simple use case. In more complicated algorithms, you need to split the `init` hook into another `init` hook and a `beforeRequest` hook. - The `error.request` property is no longer a `ClientRequest` instance. Instead, it gives a Got stream, which provides a set of useful properties. ```js const got = require('got'); (async () => { try { await got('https://sindresorhus.com/notfound'); } catch (error) { console.log(`Request failed: ${error.message}`); console.log('Download progress:', error.request.downloadProgress); } })(); ``` ##### Renamed TypeScript types Some of the TypeScript types have been renamed to improve the readability:
Old type New type
ResponseObject Response
Defaults InstanceDefaults
DefaultOptions Defaults
DefaultRetryOptions RequiredRetryOptions
GotOptions Options
GotRequestMethod GotRequestFunction
##### Other - Now requires Node.js 10.19 or later. ##### Enhancements HTTP2 support is here! Excited? Yay! Unfortunately, it's off by default to make the migration smoother. Many Got users have set up their own Agents and we didn't want to break them. But fear no more, it will come enabled by default in Got 12. ```js const got = require('got'); (async () => { const response = await got('https://nghttp2.org/httpbin/anything', {http2: true}); console.log(response.socket.alpnProtocol); //=> 'h2' })(); ``` 1. The `merge` function is slow ([#​1016](https://togithub.com/sindresorhus/got/issues/1016)) 2. Use `error.code` instead of `error.message` to compare errors ([#​981](https://togithub.com/sindresorhus/got/issues/981)) 3. Pass error thrown in the `init` hook to `beforeError` hook ([#​929](https://togithub.com/sindresorhus/got/issues/929)) 4. Errors have undefined body when using streams ([#​1138](https://togithub.com/sindresorhus/got/issues/1138)) 5. Spaces should be normalized as `+` in query strings ([#​1113](https://togithub.com/sindresorhus/got/issues/1113)) 6. Modify response headers while using `got.stream(...)` ([#​1129](https://togithub.com/sindresorhus/got/issues/1129)) 7. Make `error.request` a Got stream ([`af0b147`](https://togithub.com/sindresorhus/got/commit/af0b1472abf48a6c5491dcb36a1d8863c5227fb3)). ##### Known bugs 1. When some errors occur, the `timings` may indicate that the request was successful although it failed. 2. When some errors occur, the `downloadProgress` object may show incorrect data. ##### Bug fixes 1. Requests to UNIX sockets are missing query strings ([#​1036](https://togithub.com/sindresorhus/got/issues/1036)) 2. `beforeRequest` hooks aren't called on redirects ([#​994](https://togithub.com/sindresorhus/got/issues/994)) 3. Errors are swallowed when using `stream.pipeline(got.stream(...), ...)` ([#​1026](https://togithub.com/sindresorhus/got/issues/1026)) 4. Cannot use the `cache` along with the `body` option ([#​1021](https://togithub.com/sindresorhus/got/issues/1021)) 5. Got doesn't throw on leading slashes ([#​1057](https://togithub.com/sindresorhus/got/issues/1057)) 6. Got throws when passing already frozen options ([#​1050](https://togithub.com/sindresorhus/got/issues/1050)) 7. Cannot type Got options properly due to missing types ([#​954](https://togithub.com/sindresorhus/got/issues/954)) 8. `got.mergeOptions(...)` doesn't merge `URLSearchParams` instances ([#​1011](https://togithub.com/sindresorhus/got/issues/1011)) 9. The `authorization` header is leaking ([#​1090](https://togithub.com/sindresorhus/got/issues/1090)) 10. Pagination should ignore the `resolveBodyOnly` option ([#​1140](https://togithub.com/sindresorhus/got/issues/1140)) 11. Cannot reuse user-provided options ([#​1118](https://togithub.com/sindresorhus/got/issues/1118)) 12. Broken with Node.js ā‰„ 13.10.0 ([#​1107](https://togithub.com/sindresorhus/got/issues/1107)) 13. Cache is not decompressed ([#​1158](https://togithub.com/sindresorhus/got/issues/1158)) 14. `beforeRetry` hooks are missing `options.context` ([#​1141](https://togithub.com/sindresorhus/got/issues/1141)) 15. `promise.json()` doesn't throw `ParseError` ([#​1069](https://togithub.com/sindresorhus/got/issues/1069)) 16. Not compatible with `tough-cookie@4.0.0` ([#​1131](https://togithub.com/sindresorhus/got/issues/1131)) 17. Shortcuts give body from the failed request on token renewal ([#​1120](https://togithub.com/sindresorhus/got/issues/1120)) 18. No effect when replacing the `cache` option in a Got instance ([#​1098](https://togithub.com/sindresorhus/got/issues/1098)) 19. Memory leak when using `cache` ([#​1128](https://togithub.com/sindresorhus/got/issues/1128)) 20. Got doesn't throw on aborted requests by the server ([#​1096](https://togithub.com/sindresorhus/got/issues/1096)) ##### All changes ### [`v10.7.0`](https://togithub.com/sindresorhus/got/releases/tag/v10.7.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.6.0...v10.7.0) - Fix `got.paginate(ā€¦)` TypeScript typings ([#​1099](https://togithub.com/sindresorhus/got/issues/1099)) [`0b798ea`](https://togithub.com/sindresorhus/got/commit/0b798ea) - Pass `allItems` and `currentItems` to `_pagination.paginate()` ([#​1100](https://togithub.com/sindresorhus/got/issues/1100)) [`1cddd52`](https://togithub.com/sindresorhus/got/commit/1cddd52) - Do not ignore `decompress-response` when bundling ([#​1105](https://togithub.com/sindresorhus/got/issues/1105)) [`88f973f`](https://togithub.com/sindresorhus/got/commit/88f973f) - Avoid parsing JSON twice in `_pagination.transform` ([#​1102](https://togithub.com/sindresorhus/got/issues/1102)) [`cf4fdad`](https://togithub.com/sindresorhus/got/commit/cf4fdad) ### [`v10.6.0`](https://togithub.com/sindresorhus/got/releases/tag/v10.6.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.5.7...v10.6.0) - Add [`allowGetBody`](https://togithub.com/sindresorhus/got#allowgetbody) option to allow GET requests with payload ([#​1081](https://togithub.com/sindresorhus/got/issues/1081)) [`526b4bb`](https://togithub.com/sindresorhus/got/commit/526b4bb) ### [`v10.5.7`](https://togithub.com/sindresorhus/got/releases/tag/v10.5.7) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.5.6...v10.5.7) - Fix Init hooks not being called if extended [`acefaa4`](https://togithub.com/sindresorhus/got/commit/acefaa4c2a0cb3c33b3f952be29ac0a9cb316e87) ### [`v10.5.6`](https://togithub.com/sindresorhus/got/releases/tag/v10.5.6) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.5.5...v10.5.6) - Fix Init hook logic [`64aeb40`](https://togithub.com/sindresorhus/got/commit/64aeb40d824008db48c956a3e03807383be62090) - Update dependencies [`32e609f`](https://togithub.com/sindresorhus/got/commit/32e609f3bb4c4021cf8b98886efa9bc23e99cc9d) ### [`v10.5.5`](https://togithub.com/sindresorhus/got/releases/tag/v10.5.5) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.5.4...v10.5.5) - Fix merging pagination options [`1f363b9`](https://togithub.com/sindresorhus/got/commit/1f363b976cd23626462314c7cd5670cddd951c73) ### [`v10.5.4`](https://togithub.com/sindresorhus/got/releases/tag/v10.5.4) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.5.3...v10.5.4) - Fix `_pagination` not falling back to defaults [`ff1dba1`](https://togithub.com/sindresorhus/got/commit/ff1dba1e0c6f190da55d2799ebaa7a167f49ae9a) ### [`v10.5.3`](https://togithub.com/sindresorhus/got/releases/tag/v10.5.3) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.5.2...v10.5.3) - Fix unhandled errors if throwing in an async handler [`518d95a`](https://togithub.com/sindresorhus/got/commit/518d95aba5fde83d6708ee1289561fa445870436) ### [`v10.5.2`](https://togithub.com/sindresorhus/got/releases/tag/v10.5.2) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.5.1...v10.5.2) - Forgot to include required `p-event` dependency [`8373112`](https://togithub.com/sindresorhus/got/commit/8373112) ### [`v10.5.1`](https://togithub.com/sindresorhus/got/releases/tag/v10.5.1) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.5.0...v10.5.1) - Wait until body file descriptor is open ([#​1054](https://togithub.com/sindresorhus/got/issues/1054)) [`453a3a3`](https://togithub.com/sindresorhus/got/commit/453a3a3) ### [`v10.5.0`](https://togithub.com/sindresorhus/got/releases/tag/v10.5.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.4.0...v10.5.0) - Add experimental [pagination](https://togithub.com/sindresorhus/got#pagination) feature ([#​833](https://togithub.com/sindresorhus/got/issues/833)) [`761c7c6`](https://togithub.com/sindresorhus/got/commit/761c7c6) We're looking for [feedback](https://togithub.com/sindresorhus/got/issues/1052) on how it works. ### [`v10.4.0`](https://togithub.com/sindresorhus/got/releases/tag/v10.4.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.3.0...v10.4.0) - Update `@szmarczak/cacheable-lookup` dependency [`d527dae`](https://togithub.com/sindresorhus/got/commit/d527dae) - Include invalid JSON body in `ParseError`s ([#​1044](https://togithub.com/sindresorhus/got/issues/1044)) [`2813b73`](https://togithub.com/sindresorhus/got/commit/2813b73) - Fix `got.stream(...)` not throwing `ReadError`s [`1f6ca6b`](https://togithub.com/sindresorhus/got/commit/1f6ca6b) ### [`v10.3.0`](https://togithub.com/sindresorhus/got/releases/tag/v10.3.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.2.2...v10.3.0) - Allow request body to be sent with a DELETE request ([#​1037](https://togithub.com/sindresorhus/got/issues/1037)) [`17d629a`](https://togithub.com/sindresorhus/got/commit/17d629a) - Reject normalization errors with CancelableRequest ([#​1035](https://togithub.com/sindresorhus/got/issues/1035)) [`fddecab`](https://togithub.com/sindresorhus/got/commit/fddecab) - Export `GotRequestMethod` TypeScript type ([#​1017](https://togithub.com/sindresorhus/got/issues/1017)) [`f02694e`](https://togithub.com/sindresorhus/got/commit/f02694e) - Export `ReadError` TypeScript type ([#​1027](https://togithub.com/sindresorhus/got/issues/1027)) [`d222164`](https://togithub.com/sindresorhus/got/commit/d222164) ### [`v10.2.2`](https://togithub.com/sindresorhus/got/releases/tag/v10.2.2) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.2.1...v10.2.2) - Do not include a `request` option in normalized `http` options [`61009b3`](https://togithub.com/sindresorhus/got/commit/61009b3) ### [`v10.2.1`](https://togithub.com/sindresorhus/got/releases/tag/v10.2.1) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.2.0...v10.2.1) - Ensure `got.mergeOptions(...)` can be assigned to defaults ([#​1008](https://togithub.com/sindresorhus/got/issues/1008)) [`1360a1b`](https://togithub.com/sindresorhus/got/commit/1360a1b) - The `url` option is mutually exclusive with the `url` input argument [`e0f8aab`](https://togithub.com/sindresorhus/got/commit/e0f8aab) - Update `RetryObject['error']` TypeScript types [`5008bf7`](https://togithub.com/sindresorhus/got/commit/5008bf7) - Upgrade `@szmarczak/http-timer` dependency [`a1b8ffc`](https://togithub.com/sindresorhus/got/commit/a1b8ffc) ### [`v10.2.0`](https://togithub.com/sindresorhus/got/releases/tag/v10.2.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.1.0...v10.2.0) - Soft-deprecate `electron.net` support ([#​995](https://togithub.com/sindresorhus/got/issues/995)) [`b2f8ace`](https://togithub.com/sindresorhus/got/commit/b2f8ace) - See [https://github.com/sindresorhus/got/issues/899#issuecomment-565728281](https://togithub.com/sindresorhus/got/issues/899#issuecomment-565728281). When the support is removed, you'll still be able to use Got in the Electron main process and in the renderer process through the `electron.remote` module or if you use Node.js shims. - Do not throw if `hostname` is not present [`dc53747`](https://togithub.com/sindresorhus/got/commit/dc53747) - Fix unhandled `Premature close` errors [`fa60b5f`](https://togithub.com/sindresorhus/got/commit/fa60b5f) ### [`v10.1.0`](https://togithub.com/sindresorhus/got/releases/tag/v10.1.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.0.4...v10.1.0) ##### Enhancements - Retry after certain Cloudflare errors ([#​991](https://togithub.com/sindresorhus/got/issues/991)) [`0569d45`](https://togithub.com/sindresorhus/got/commit/0569d45) ##### Fixes - Fix `content-length` header not being set when using custom `content-type` [`3149340`](https://togithub.com/sindresorhus/got/commit/3149340) - Emit timeout errors as soon as possible [`912c2e5`](https://togithub.com/sindresorhus/got/commit/912c2e5) [`7bf92f4`](https://togithub.com/sindresorhus/got/commit/7bf92f4) ### [`v10.0.4`](https://togithub.com/sindresorhus/got/releases/tag/v10.0.4) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.0.3...v10.0.4) - Fix type conflicts for `URL` and `URLSearchParams` types ([#​983](https://togithub.com/sindresorhus/got/issues/983)) [`cd4226d`](https://togithub.com/sindresorhus/got/commit/cd4226d) Just working around yet another TypeScript b[https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34960](https://togithub.com/DefinitelyTyped/DefinitelyTyped/issues/34960)4960 ### [`v10.0.3`](https://togithub.com/sindresorhus/got/releases/tag/v10.0.3) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.0.2...v10.0.3) - Fix the `responseType` option ([`071bf5e`](https://togithub.com/sindresorhus/got/commit/071bf5ed39a1262b1bf806067752395421090a23)) - Fix unhandled `Premature close` and `Request timed out` errors ([`7b2ccb0`](https://togithub.com/sindresorhus/got/commit/7b2ccb0d69fca9aba27373ab344f97d389d692f2)) - Make `options.path` backwards-compatible ([`b3f1ac9`](https://togithub.com/sindresorhus/got/commit/b3f1ac9c9725459f4ffab9baa20b9459d3495fba)) ### [`v10.0.2`](https://togithub.com/sindresorhus/got/releases/tag/v10.0.2) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.0.1...v10.0.2) - Fix TypeScript type problem with `URL` and `URLSearchParams` globals ([#​969](https://togithub.com/sindresorhus/got/issues/969)) [`2d5e28d`](https://togithub.com/sindresorhus/got/commit/2d5e28d) - Fix `got.mergeOptions(...)` TypeScript type ([#​953](https://togithub.com/sindresorhus/got/issues/953)) [`b962d08`](https://togithub.com/sindresorhus/got/commit/b962d08) - Fix unhandled timeout errors when connection drops [`5a8f461`](https://togithub.com/sindresorhus/got/commit/5a8f461) ### [`v10.0.1`](https://togithub.com/sindresorhus/got/releases/tag/v10.0.1) [Compare Source](https://togithub.com/sindresorhus/got/compare/v10.0.0...v10.0.1) - Fix using the `json` option with `got.stream.post` [`2ec5c4d`](https://togithub.com/sindresorhus/got/commit/2ec5c4d) ### [`v10.0.0`](https://togithub.com/sindresorhus/got/releases/tag/v10.0.0) [Compare Source](https://togithub.com/sindresorhus/got/compare/v9.6.0...v10.0.0) We're excited to announce Got 10! šŸŽ‰ This release has been in the works for almost a year and has been a major undertaking. Got was fully rewritten in TypeScript, which helped us catch many bugs and will give us more confidence in the codebase going forward. Got is now faster and much more stable. We also fixed a huge amount of bugs. Big thanks to everyone that helped make this release possible. šŸ™Œ *** *If you find Got useful, you might want to [sponsor the Got maintainers](https://togithub.com/sindresorhus/got?sponsor=1).* **Note:** Some HTTP agents like `https-proxy-agent` and `agentkeepalive` are not compatible with Node.js 10 and hence not compatible with Got as Got takes advantage of some Node.js 10-only APIs. ##### Breaking - Require Node.js 10 [`633651f`](https://togithub.com/sindresorhus/got/commit/633651f) - Why: This is so that we can use `stream.pipeline` for more reliable stream handling. Node.js 8 will be out of LTS at the end of this month anyway. - Remove support for protocol-less URLs in the `url` argument [`92bc808`](https://togithub.com/sindresorhus/got/commit/92bc808) - Why: To reduce ambiguity. It was not clear from just reading the code what it would default to. - Migrate: ```diff - got('sindresorhus.com'); + got('https://sindresorhus.com'); ``` - Rename the `query` option to `searchParams` and make it stricter [`b223663`](https://togithub.com/sindresorhus/got/commit/b223663) [`5376216`](https://togithub.com/sindresorhus/got/commit/5376216) [`518f0f5`](https://togithub.com/sindresorhus/got/commit/518f0f5906e1fcd38691555b17fb91db643f3d47) - Why: To get closer to the `window.fetch` naming in the browser. - Migrate: ```diff - got(ā€¦, {query: ā€¦}); + got(ā€¦, {searchParams: ā€¦}); ``` - Replace the `baseUrl` option with `prefixUrl` ([#​829](https://togithub.com/sindresorhus/got/issues/829)) [`0d534ed`](https://togithub.com/sindresorhus/got/commit/0d534ed) - Note: We also made it stricter to reduce ambiguity. The Got `url` argument now [cannot be prefixed with a slash](https://togithub.com/sindresorhus/got#prefixurl) when this option is used. - Why: We renamed it to make it clear that it doesn't do any URL resolution. - Migrate: ```diff - got('/foo', {baseUrl: 'https://x.com'}); + got('foo', {prefixUrl: 'https://x.com'}); ``` - Change the `json` option to accept an object instead of a boolean and to only be responsible for the request, not the response ([#​704](https://togithub.com/sindresorhus/got/issues/704)) [`a6a7d5a`](https://togithub.com/sindresorhus/got/commit/a6a7d5a) - Note: You now set the request body in this option instead of the `body` option when you want to send JSON. This option also no longer sets the response type to JSON. You either call the `.json()` method or specify the `responseType` option for that. - Why: Many people were confused how `{json: true}` worked and they also complained that they could not set the request/response type individually. - Migrate: ```diff - got(url, {body: {x: true}, json: true}); + got.post(url, {json: {x: true}}).json(); ``` - Use the [`responseType`](https://togithub.com/sindresorhus/got#responsetype) option instead of [`encoding`](https://togithub.com/sindresorhus/got#encoding) to get a Buffer ([#​940](https://togithub.com/sindresorhus/got/issues/940)) [`6cc3d9f`](https://togithub.com/sindresorhus/got/commit/6cc3d9f) - Why: Previously, you would pass `{encoding: null}` to get a Buffer, but this was confusing. You now use `{responseType: 'buffer'}` instead. - Tip: You can also use `got(ā€¦).buffer();`. - Migrate: ```diff - got(ā€¦, {encoding: null}); + got(ā€¦, {responseType: 'buffer'}); ``` - Don't infer `POST` automatically when specifying `body` ([#​756](https://togithub.com/sindresorhus/got/issues/756)) [`e367bdb`](https://togithub.com/sindresorhus/got/commit/e367bdb) - Why: We're trying to reduce the amount of magic behavior. - Migrate: ```diff - got(ā€¦, {body: 'foo'}); + got.post(ā€¦, {body: 'foo'}); ``` - The `retries.retry` option was split into `retries.limit` and `retries.calculateDelay` [`b15ce1d`](https://togithub.com/sindresorhus/got/commit/b15ce1d) - Migrate: ```diff got(ā€¦, { retry: { - retries: 2 + limit: 2 } }); ``` ```diff got(ā€¦, { retry: { - retries: iteration => iteration < 2 + calculateDelay: ({attemptCount}) => attemptCount < 2 } }); ``` - Use `undefined` instead of `null` to omit a header (https://github.com/sindresorhus/got#headers) [`518f0f5`](https://togithub.com/sindresorhus/got/commit/518f0f5906e1fcd38691555b17fb91db643f3d47) - Why: We're trying to [reduce the use of `null`](https://togithub.com/sindresorhus/meta/issues/7). - Migrate: ```diff got(ā€¦, { headers: { - 'user-agent': null + 'user-agent': undefined } }); ``` - Rename the Promise API property `.fromCache` to `.isFromCache` ([#​768](https://togithub.com/sindresorhus/got/issues/768)) [`b5e443b`](https://togithub.com/sindresorhus/got/commit/b5e443b) - Rename the `stream` option to `isStream` [`518f0f5`](https://togithub.com/sindresorhus/got/commit/518f0f5906e1fcd38691555b17fb91db643f3d47) - Why: To make it clearer that it's a boolean and that it doesn't expect a stream to be passed in. - Migrate: ```diff - got(ā€¦, {stream: true}); + got(ā€¦, {isStream: true}); ``` - Don't include the Got version in the default `user-agent` header ([#​911](https://togithub.com/sindresorhus/got/issues/911)) [`95bed1e`](https://togithub.com/sindresorhus/got/commit/95bed1e) - `got/9.6.0 (https://github.com/sindresorhus/got)` ā†’ `got (https://github.com/sindresorhus/got)` - Why: Importing package.json to get the version caused a lot of problems. And you should ideally set your own `user-agent` header anyway. - Remove `got.create()` [`518f0f5`](https://togithub.com/sindresorhus/got/commit/518f0f5906e1fcd38691555b17fb91db643f3d47) - You can achieve the same thing with `got.extend()` now. - Remove `got.mergeInstances()` [`518f0f5`](https://togithub.com/sindresorhus/got/commit/518f0f5906e1fcd38691555b17fb91db643f3d47) - Use `gotInstance.extend(...gotInstances)` instead. - Move top-level error properties into an `.options` and `.response` property ([#​773](https://togithub.com/sindresorhus/got/issues/773)) [`6eaa81b`](https://togithub.com/sindresorhus/got/commit/6eaa81b) - Migrate: ```diff - error.gotOptions + error.options - error.headers + error.response.headers - error.statusCode + error.response.statusCode - error.statusMessage + error.response.statusMessage - error.body + error.response.body - error.redirectUrls + error.response.redirectUrls - error.host + error.options.host - error.hostname + error.options.hostname - error.method + error.options.method - error.protocol + error.options.protocol - error.url + error.options.url - error.path + error.options.path ``` - Custom instance creation was simplified ([#​707](https://togithub.com/sindresorhus/got/issues/707)) [`8eaef94`](https://togithub.com/sindresorhus/got/commit/8eaef94) - Note: `got.mergeInstances(...instances)` is deprecated. Use `instanceA.extend(instanceB)` instead. - Migrate: ```diff ### Merging instances - got.mergeInstances(instanceA, instanceB, instanceC, ā€¦); + instanceA.extend(instanceB, instanceC, ā€¦); ### Merging options - instanceA.extend(optionsB).extend(optionsC).extend(ā€¦); + instanceA.extend(optionsB, optionsC, ā€¦); ### Merging instances and options - got.mergeInstances(instanceA.extend(optionsB), instanceC); + instanceA.extend(optionsB, instanceC, ā€¦); ### Extending handlers - got.mergeInstances(instanceA, got.create({handler: handlerB})); + instanceA.extend({handlers: [handlerB]}); ``` ##### Enhancements - Got has been rewritten in TypeScript. - Why: This means we can provide our own type definitions and we can be more confident when working on the Got codebase and produce less bugs. Huge thanks to [@​pmmmwh](https://togithub.com/pmmmwh), [@​LinusU](https://togithub.com/LinusU), [@​vladfrangu](https://togithub.com/vladfrangu), [@​mastermatt](https://togithub.com/mastermatt), and everyone else that helped us with this rewrite. šŸ™Œ - Add support for [Brotli](https://en.wikipedia.org/wiki/Brotli) (Node.js 12 and later) ([#​706](https://togithub.com/sindresorhus/got/issues/706)) [`d5d2e6f`](https://togithub.com/sindresorhus/got/commit/d5d2e6f) - Add opt-in [DNS cache](https://togithub.com/sindresorhus/got#dnscache) ([#​731](https://togithub.com/sindresorhus/got/issues/731)) [`cd12351`](https://togithub.com/sindresorhus/got/commit/cd12351) - Add [`context` option](https://togithub.com/sindresorhus/got#context) for storing custom metadata across request and hooks ([#​777](https://togithub.com/sindresorhus/got/issues/777)) [`3bb5aa7`](https://togithub.com/sindresorhus/got/commit/3bb5aa7) - Add [option to ignore invalid cookies](https://togithub.com/sindresorhus/got#ignoreinvalidcookies) ([#​826](https://togithub.com/sindresorhus/got/issues/826)) [`e9c01e0`](https://togithub.com/sindresorhus/got/commit/e9c01e0) - Add [`maxRedirects` option](https://togithub.com/sindresorhus/got#maxredirects) ([#​914](https://togithub.com/sindresorhus/got/issues/914)) [`0c505b0`](https://togithub.com/sindresorhus/got/commit/0c505b0) - Allow method rewriting on redirects ([#​913](https://togithub.com/sindresorhus/got/issues/913)) [`b7ead5f`](https://togithub.com/sindresorhus/got/commit/b7ead5f) - Add [`methodRewriting` option](https://togithub.com/sindresorhus/got#methodrewriting) ([#​942](https://togithub.com/sindresorhus/got/issues/942)) [`b82358f`](https://togithub.com/sindresorhus/got/commit/b82358f) - Add ability to use something other than [`tough-cookie`](https://www.npmjs.com/package/tough-cookie) for handling cookies ([#​882](https://togithub.com/sindresorhus/got/issues/882)) [`518f0f5`](https://togithub.com/sindresorhus/got/commit/518f0f5906e1fcd38691555b17fb91db643f3d47) - Preserve stack trace when wrapping errors ([#​935](https://togithub.com/sindresorhus/got/issues/935)) [`8874a45`](https://togithub.com/sindresorhus/got/commit/8874a45) - Proxy headers from server request to Got ([#​772](https://togithub.com/sindresorhus/got/issues/772)) [`00e5fd5`](https://togithub.com/sindresorhus/got/commit/00e5fd5) - Pass the response as the second argument to the `beforeRedirect` hook ([#​812](https://togithub.com/sindresorhus/got/issues/812)) [`3557896`](https://togithub.com/sindresorhus/got/commit/3557896) - Throw on canceled request with incomplete response ([#​767](https://togithub.com/sindresorhus/got/issues/767)) [`92b1005`](https://togithub.com/sindresorhus/got/commit/92b1005) - Add [`.isFromCache` property](https://togithub.com/sindresorhus/got#streams-1) to the stream API ([#​768](https://togithub.com/sindresorhus/got/issues/768)) [`b5e443b`](https://togithub.com/sindresorhus/got/commit/b5e443b) - The [`timeout` option](https://togithub.com/sindresorhus/got#timeout) can now be modified in hooks [`d520a3a`](https://togithub.com/sindresorhus/got/commit/d520a3a) - The [`prefixUrl` option](https://togithub.com/sindresorhus/got#prefixurl) can now be modified in hooks ([https://github.com/sindresorhus/got/issues/867](https://togithub.com/sindresorhus/got/issues/867)) [`518f0f5`](https://togithub.com/sindresorhus/got/commit/518f0f5906e1fcd38691555b17fb91db643f3d47) - Make `URLSearchParams` instances mergeable ([#​734](https://togithub.com/sindresorhus/got/issues/734)) [`95c7c2c`](https://togithub.com/sindresorhus/got/commit/95c7c2c) ##### Fixes - Fix parsing response when using `afterResponse` hook ([#​775](https://togithub.com/sindresorhus/got/issues/775)) [`e2054cd`](https://togithub.com/sindresorhus/got/commit/e2054cd) - Fix `port` not being reset on redirect ([#​729](https://togithub.com/sindresorhus/got/issues/729)) [`ada5861`](https://togithub.com/sindresorhus/got/commit/ada5861) - Fix the retry functionality ([#​787](https://togithub.com/sindresorhus/got/issues/787)) [`0501e00`](https://togithub.com/sindresorhus/got/commit/0501e00) - Fix default `retry` option value when specifying a number ([#​809](https://togithub.com/sindresorhus/got/issues/809)) [`9c04a7c`](https://togithub.com/sindresorhus/got/commit/9c04a7c) - Correctly handle promise- and stream-specific errors in the `beforeError` hook [`134c9b7`](https://togithub.com/sindresorhus/got/commit/134c9b7) - Don't throw on early lookups [`4faf5c7`](https://togithub.com/sindresorhus/got/commit/4faf5c7) - Fix Node.js 13 compatibility ([#​915](https://togithub.com/sindresorhus/got/issues/915)) [`b0dfc95`](https://togithub.com/sindresorhus/got/commit/b0dfc95) - Fix memory leak when using cache feature ([#​792](https://togithub.com/sindresorhus/got/issues/792)) [`518f0f5`](https://togithub.com/sindresorhus/got/commit/518f0f5906e1fcd38691555b17fb91db643f3d47) - Don't throw on `204 No Content` when parsing response ([#​925](https://togithub.com/sindresorhus/got/issues/925)) [`518f0f5`](https://togithub.com/sindresorhus/got/commit/518f0f5906e1fcd38691555b17fb91db643f3d47) - When redirect fails, don't retry from scratch ([#​930](https://togithub.com/sindresorhus/got

Configuration

šŸ“… Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

šŸš¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.

ā™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

šŸ”• Ignore: Close this PR and you won't be reminded about this update again.



This PR has been generated by Mend Renovate. View repository job log here.