Open
Conversation
fa747ea to
4fc7863
Compare
4fc7863 to
e37ee20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
14.4.4→15.0.3Release Notes
sindresorhus/got (got)
v15.0.3Compare Source
ReadErroron responses withoutContent-Length071ea07v15.0.2Compare Source
b170125v15.0.1Compare Source
20633bcv15.0.0Compare Source
Breaking changes
b933476a06ac6cpromise.cancel()is gone. Use thesignaloption withAbortControllerinstead.isStreamoptionc241c6cgot.stream()directly.FormDataglobal670b228FormDataglobal directly (available in Node.js 18+).responseType: 'buffer'returnsUint8Arrayinstead ofBuffer309e36dresponse.rawBodyandpromise.buffer()now return aUint8Array.Bufferis a subclass ofUint8Array, so most code will continue to work, but strict type checks will need updating.strictContentLengthdefaults totrue08e9dffContentLengthMismatchErrorby default ifContent-Lengthdoesn't match the actual body size. Set{strictContentLength: false}to restore the old behavior.retry.enforceRetryRulesdefaults totrue9bc8dfbcalculateDelayfunctions are now only called when a retry is actually allowed bylimit,methods,statusCodes, anderrorCodes. If yourcalculateDelaywas previously used to override retry eligibility unconditionally, set{retry: {enforceRetryRules: false}}.8e392f3{copyPipedHeaders: true}to re-enable. Hop-by-hop headers are never copied even when enabled (RFC 9110 §7.6.1).urlremoved from public options objects87de8d6urlproperty is no longer present on the options object passed to hooks. Useresponse.urlorrequest.requestUrlinstead.5fccaabImprovements
text/jsonbodies incrementally for lower peak memory usagec9a95b1uploadProgressnow emits granular per-chunk events forjsonandformrequest bodies13c889dMigration guide
Replace
promise.cancel()withAbortControllerBefore:
After:
Replace
isStream: truewithgot.stream()Before:
After:
Replace
form-data/form-data-encoderwith nativeFormDataBefore:
After:
Update
Bufferusage toUint8Arrayresponse.rawBodyandpromise.buffer()now returnUint8Arrayinstead ofBuffer.Before:
After:
If you need
Buffer-specific APIs, wrap withBuffer.from(data.buffer, data.byteOffset, data.byteLength).strictContentLengthis now on by defaultIf you send requests where the
Content-Lengthheader might not match the actual body size, opt out:retry.enforceRetryRulesis now on by defaultIf your
calculateDelayfunction was overriding retry eligibility (e.g. retrying on methods or status codes outside the defaults), opt out:Piped header copying is now opt-in
If you pipe streams into Got and rely on automatic header forwarding (e.g.
Content-Type), re-enable it:300 and 304 responses are no longer followed
If your code depended on Got auto-following 300 Multi-Choice or handling 304 Not Modified as a redirect, you now need to handle them yourself in an
afterResponsehook or checkresponse.statusCodemanually.v14.6.6Compare Source
4d5168cb65b0e1, where it incorrectly auto-closed streams for empty PATCH/DELETE/OPTIONS when using streams. This broke the documented use case of piping data to a got stream for these methods.v14.6.5Compare Source
got.extend()withresponseTypeoptionf7ab6e9v14.6.4Compare Source
dnsLookupoption type to accept Node.jsdns.lookup47c3155v14.6.3Compare Source
fb03d8461d5e3bv14.6.2Compare Source
0a16a9cv14.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
c079b93Configuration
📅 Schedule: (UTC)
🚦 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.