This repository was archived by the owner on Jan 20, 2023. It is now read-only.
chore(deps): update dependency got to v12 #172
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->12.5.3Release Notes
sindresorhus/got
v12.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 https://github.com/sindresorhus/got/issues/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 https://github.com/nodejs/node/issues/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 any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ 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.