fix(deps): update dependency got to v14 #163
Open
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
11.8.6->14.6.1Release Notes
sindresorhus/got (got)
v14.6.1Compare Source
v14.6.0Compare Source
Improvements
beforeCachehook1c3a041retryCounttobeforeRequesthook context91cdc48HTTPErrormessage to include method and URL6dd7574ecf56333e2a781beforeErrorhook1c71194449833af5c54a3strictContentLengthoption4206f0ehttps.secureOptionsoption7ec1714copyPipedHeadersoption to control automatic header copying from piped streamsd83daddstream.isReadonlyproperty to detect read-only streams030dfbbFixes
398c11af004564beforeRetryhooksbf84d36beforeErrorhook not being called forERR_UNSUPPORTED_PROTOCOLerrorfb86418prefixUrlin hooks9725fbd1e497812527bf6content-lengthwhen piping decompressed responses30b3b796ae3e7fe09a9bd6a544a3afterResponsehook validation to allownullbody values60a44193d66aectimings.endbeing undefined when stream is destroyed before completion4e75679e5659d4Meta
I managed to get it almost down to zero issues! 🎉
v14.5.0Compare Source
retry.enforceRetryRulesoption to fix statusCodes/limit bypassing7c0aee6serverNameHTTPS optioncdaab63preserveHooksoption forretryWithMergedOptions1abeba4IterableandAsyncIterableas request bodyb65b0e12ab94fda2812dedownloadProgressfiring for redirect responses9ec6ff0e899c07falseas agent value6961284d1d4ed223d0b6b724d592dc4f1e3v14.4.9Compare Source
content-encodingheaders but no bodycc434bcv14.4.8Compare Source
request.optionsinafterResponsehookdad6a91v14.4.7Compare Source
06029e0v14.4.6Compare Source
7a92064v14.4.5Compare Source
c079b93v14.4.4Compare Source
AbortSignal#timeout()(#2388)92b378ev14.4.3Compare Source
f2f8cb2v14.4.2Compare Source
f44ef43v14.4.1Compare Source
dfc54d9v14.4.0Compare Source
15ca4a0v14.3.0Compare Source
dbab6c3v14.2.1Compare Source
c81a611v14.2.0Compare Source
causeproperty with the original error toRequestError(#2327)4cbd01dv14.1.0Compare Source
RequestErrorresponse (#2325)5e4f6ffv14.0.0Compare Source
Breaking
a004263Improvements
followRedirectoption accept a function (#2306)7c3f147v13.0.0Compare Source
As a reminder, Got continues to require ESM. For TypeScript users, this includes having
"module": "node16", "moduleResolution": "node16"in your tsconfig.Breaking
52a1063enableUnixSocketsoption to befalseby default852c312Improvements
undefinedfor options (#2258)1cefe8bv12.6.1Compare Source
get-streamimport statement (#2266)67d5039v12.6.0Compare Source
88c88fb979272e0ca0b7fv12.5.3Compare Source
3cc40b5v12.5.2Compare Source
39f83b6v12.5.1Compare Source
3b3ea673e9d3afv12.5.0Compare Source
e049e948630815f0ac0b34c3762av12.4.1Compare Source
Fixes
options.contextbeing not extensibleb671480uploadProgressafter promise cancelation693de21v12.4.0Compare Source
Improvements
850773cFixes
beforeErrorhooks withHTTPErrorif thethrowHttpErrorsoption isfalse(#2104)3927348v12.3.1Compare Source
43b1467v12.3.0Compare Source
.off()method for events (#2092)88056bev12.2.0Compare Source
AbortController(#2020)6a6d2a9enableUnixSocketsoption (#2062)461b3d4v12.1.0Compare Source
Improvements
response.ok(#2043)22d58fb{throwHttpErrors: false}Fixes
861ccd9v12.0.4Compare Source
bb8eca9v12.0.3Compare Source
jsonoption (#2015)eb045bfv12.0.2Compare Source
encodingoption with{responseType: 'json'}(#1996)0703318v12.0.1Compare Source
nockcompatibility (#1959)bf39d2cRequestTypeScript type (#1940)0f9f2b8v12.0.0Compare Source
Introducing Got v12.0.0 🎉
Long time no see! The latest Got version (v11.8.2) was released just in February ❄️
We have been working hard on squashing bugs and improving overall experience.
If you find Got useful, you might want to sponsor the Got maintainers.
This package is now pure ESM
Please read this. Also see #1789.
[ERR_REQUIRE_ESM]andMust use import to load ES Moduleerrors. This is a problem with your setup, not Got.Required Node.js >=14
While working with streams, we encountered more Node.js bugs that needed workarounds.
In order to keep our code clean, we had to drop Node.js v12 as the code would get more messy.
We strongly recommend that you update Node.js to v14 LTS.
HTTP/2 support
Every Node.js release, the native
http2module gets more stable.Unfortunately there are still some issues on the Node.js side, so we decided to keep HTTP/2 disabled for now.
We may enable it by default in Got v13. It is still possible to turn it on via the
http2option.To run HTTP/2 requests, it is required to use Node.js v15.10 or above.
Bug fixes
Woah, we possibly couldn't make a release if we didn't fix some bugs!
49c16eecontent-lengthon ReadStream (#1510)472b8efff918fb1107cc6methodRewritingoption51d88a0urlnot being reused on retry in rare case (#1487)462bc63a59fac477df9c362305d706a2d3d1e1e506response.completewhen using cache9e15d88Cannot call enderror whenrequestreturns aWritable226cc393c23eea3c23eeagot.paginate does not call init hooks(#1574)3c23eeahttpsmodule (#1567)3c23eea9ecc5eesearchParams(#1814)1018c20732e9bd2453e5e439fb82eda69ffusernameandpasswordencoding in URL (#1169 #1317)d65d0ca1c4cefcafterResponsereturn checkcbc8902https.alpnProtocolsnot having an effecte1099fbImprovements
contextoption mergeable (#1459)2b8ed1f6fc04a9e943672(blocked by nodejs/node#35923)267504611203704f21eb3retry.backoffLimitoption41c4136noiseretry optione83007783575d5fe723a0(thanks @Giotino)error.codef27e8d3options.urleven if some options are invalid8d6a6802db5ec5854430f3df52f3oncetypes for Stream API3c23eeaRetryErrorwhich always triggers a new retry when thrown3c23eeaerror.optionsis now enumerable3c23eeadefaults.handlersdon't need a default handler now3c23eeaLinkheader3c23eeaa5dd9aaBreaking changes
Improved option normalization
Optionclass that is specifically designed to parse and validate Got options.It is made of setters and getters that provide fast normalization and more consistent behavior.
When passing an option does not exist, Got will throw an error. In order to retrieve the options before the error, use
error.options.inithook now accepts a second argument:self, which points to anOptionsinstance.In order to define your own options, you have to move them to
options.contextin aninithook or store them inoptions.contextdirectly.inithooks are ran only when passing an options object explicitly.options.merge()replacedgot.mergeOptionsandRequest.normalizeArgumentsThis fixes issues like #1450
Urlinstances are not supported anymore. You need to use WHATWG URL instead.dnsLookupIpVersionis now a number (4 or 6) or undefinedredirectUrlsandrequestUrlnow give URL instancesrequest.abortedtorequest.isAbortedReason: consistency with
options.isStream.lookupoption todnsLookupbeforeRetryhook now accepts only two arguments:errorandretryCountawait got('https://example.com', { hooks: { beforeRetry: [ - (options, error, retryCount) => { - console.log(options, error, retryCount); - } + (error, retryCount) => { + console.log(error.options, error, retryCount); + } ] } })The
optionsargument has been removed, however it's still accessible viaerror.options. All modifications onerror.optionswill be reflected in the next requests (no behavior change, same as with Got 11).beforeRedirecthook's first argument (options) is now a cloned instance of the Request options.This was done to make retrieving the original options possible:
plainResponse.request.options.await got('http://szmarczak.com', { hooks: { beforeRedirect: [ (options, response) => { - console.log(options === response.request.options); //=> true [invalid! our original options were overriden] + console.log(options === response.request.options); //=> false [we can access the original options now] } ] } })redirectevent now takes two arguments in this order:updatedOptionsandplainResponse.Reason: consistency with the
beforeRedirecthook.socketPathoption has been removed. Use theunix:protocol instead.retryWithMergedOptionsfunction in anafterResponsehook no longer returns aPromise.It now throws
RetryError, so this should this should be the last function being executed.This was done to allow
beforeRetryhooks getting called.options.agenttofalse.To do so, you need to define all the
options.agentproperties:http,httpsandhttp2.await got('https://example.com', { - agent: false + agent: { + http: false, + https: false, + http2: false + } })urloption when paginating, it now needs to be an absolute URL - theprefixUrloption is always reset from now on. The same when retrying in anafterResponsehook.There was confusion around the
prefixUrloption. It was counterintuitive if used with the Pagination API. For example, it worked fine if the server replied with a relative URL, but if it was an absolute URL then theprefixUrlwould end up duplicated. In order to fix this, Got now requires an absolute URL - noprefixUrlwill be applied.got.extend(…)will throw when passing some options that don't accept undefined - undefined no longer retains the old value, as setting undefined explicitly may reset the optionDocumentation
We have redesigned the documentation so it's easier to navigate and find exactly what you are looking for. We hope you like it ❤️
Configuration
📅 Schedule: Branch creation - At 06:00 PM through 11:59 PM and 12:00 AM through 09:59 AM ( * 18-23,0-9 * * * ) in timezone Europe/Kiev, 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 was generated by Mend Renovate. View the repository job log.