Update dependency got to v16 - #298
Merged
Merged
Conversation
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:
^15.1.0→^16.0.0Release Notes
sindresorhus/got (got)
v16.0.0Compare Source
Breaking changes
http2-wrapperdependency (#2464)1e157c4GOAWAYretirement, request and response trailers, informational (1xx) responses, abort signals, response caching, IPv6 authorities, andh2cthroughh2session.agent.http2is no longer an agent slot. It is only an opt-out flag now: passfalseto skip session pooling. Passing an agent instance throws.response.statusCodeinstead ofresponse.headers[':status'].agent.httpscombined withhttp2: truemakes Got use the native HTTP/1.1 path, because the built-in session pool does not support custom HTTPS agents.http2-wrapper. It was very buggy anyway.options.requestreturns a request or response, it controls the transport and the HTTP/2 client is bypassed. Returnundefinedto fall back to Got's own transport.cacheable-lookupdependency (#2463)bfc400bdnsCache: truenow uses Got's own cache. The option accepts any object with alookupfunction and an optionalclear(hostname?)function, so an existingCacheableLookupinstance still works if you keep the dependency yourself.verbatimaddress ordering fromdns.lookup().beforeRequesthook, anafterResponseretry, or a pagination step that moves the request to a different origin now strips credentials and drops the body (#2465)dd3b295authorization,cookie,cookie2,host, andproxy-authorizationare removed, URL credentials are dropped, and an unchanged body is cleared. Set the headers or body explicitly inside the hook if you want them to cross the origin boundary.urlor throughprefixUrl.copyPipedHeadersno longer copies credentials1d233baauthorization,cookie,cookie2,set-cookie, andset-cookie2are now omitted along withhost, the hop-by-hop headers, and anything nominated byConnection/Proxy-Connection. Pass credentials explicitly inheaderswhen the upstream is trusted.searchParameters,followRedirects, andauthoption stubs1d233baUnexpected option: ….OptionsOfUnknownResponseBodytype1d233baStrictOptions.Improvements
QUERYHTTP method (#2466)e3924aagot.query()andgot.stream.query().QUERYis safe and idempotent, so it is retried by default and keeps a replayable body across301and302redirects as well as307and308. It is not stored by the built-in cache, because correctQUERYcaching needs cache keys that include the request content.allowGetBodynow also works over HTTP/21e157c4timeout.socketnow applies during HTTP/2 TLS negotiation and session setupc6bbb8arequesttimeout. It now produces a realsockettimeout and no longer counts DNS lookup time.cacheable-lookupandhttp2-wrapperbfc400b1e157c4Fixes
request.end()instead of failing the request (#2470)67919b2Retry-After: 0instead of falling back to the backoff delay (#2471)d35ce87c6bbb8aerror.response.bodyis now complete, decompressed, and decoded with the configuredencoding, and a decoding failure no longer masks the original error.followRedirect: falsec6bbb8aset-cookiec6bbb8agot.streamfinalizing the response before theresponseevent and before piped server response headers are setc6bbb8astrictContentLengthcounting bytes from responses that were not actually decompressedc6bbb8ahooks.beforeCachealong with the other hook arrays on non-mutable defaults1d233baprefixUrlis changed to a same-origin value, and treat credentials inprefixUrlas explicitdd3b295Migration guide
HTTP/2
Remove
http2-wrapperfrom your code. Got's HTTP/2 client is built in.Before:
After:
To opt out of HTTP/2 session pooling for a request, set
agent.http2tofalse.If you need an HTTP/2 proxy, keep using
http2-wrapperthrough therequestoption. Returning a request fromrequestbypasses Got's HTTP/2 client.h2cThe
h2sessionhook example no longer needsrequestorhttp2.Before:
After:
dnsCachednsCache: truekeeps working and now uses Got's built-in cache. If you depend oncacheable-lookupspecific options, install it yourself and pass the instance:Cross-origin hooks
If a
beforeRequesthook, anafterResponseretry, or a pagination step sends the request to a different origin, set the headers and body you want to keep explicitly:copyPipedHeadersCredentials are no longer forwarded from a piped request. Pass them explicitly when the upstream is trusted:
Configuration
📅 Schedule: (in timezone America/New_York)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, 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.