build
build copied to clipboard
chore(deps): update dependency got to v11.8.5 [security]
This PR contains the following updates:
Package | Type | Update | Change | Age | Adoption | Passing | Confidence |
---|---|---|---|---|---|---|---|
got | 9.6.0 -> 11.8.5 |
||||||
got | dependencies | major | ^10.0.0 -> ^11.0.0 |
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
- Backport security fix https://github.com/sindresorhus/got/commit/861ccd9ac2237df762a9e2beed7edd88c60782dc
v11.8.3
- Bump cacheable-request dependency (#1921)
9463bb6
- Fix
HTTPError
missing.code
property (#1739)0e167b8
v11.8.2
- Make the
dnsCache
option lazy (#1529)3bd245f
This slightly improves Got startup performance and fixes an issue with Jest.
v11.8.1
v11.8.0
- Fix for sending files with size
0
onstat
(#1488)7acd380
-
beforeRetry
allows stream body if different from original (#1501)3dd2273
- Set default value for an options object (#1495)
390b145
v11.7.0
Improvements
- Add
pfx
HTTPS option (#1364)c33df7f
- Update
body
afterbeforeRequest
(#1453)e1c1844
- Don't allocate buffer twice (#1403)
7bc69d9
Fixes
- Fix a regression where body was sent after redirect
88b32ea
- Fix destructure error on
promise.json()
c97ce7c
- Do not ignore userinfo on a redirect to the same origin
52de13b
v11.6.2
Bug fixes
- Inherit the
prefixUrl
option from parent if it'sundefined
(#1448)a3da70a
- Prepare a fix for hanging promise on Node.js 14.10.x
29d4e32
- Prepare for Node.js 15.0.0
c126ff1
Docs
- Point travis-ci.org badge to travis-ci.com (#1442)
2b352d3
- Clarify the retry mechanism
f248618
- Fix
RequestError
links3ed4af6
Tests
v11.6.1
Fixes
Meta
v11.6.0
Improvements
- Add
retry
stream event (#1384)7072198
- Add types for
http-cache-semantics
options2e2295f
- Make
CancelError
inheritRequestError
1f132e8
- Add
retryAfter
toRetryObject
643a305
- Add documentation comments to exported TypeScript types (#1278)
eaf1e02
- Move cache options into a
cacheOptions
property9c16d90
Bug fixes
- Got promise shouldn't retry when the body is a stream
6e1aeae
Docs
- Add an example of nock integration with retrying
f7bbc37
- Fix
CancelError
docs28c400f
- Fix retry delay function in the
README
(#1425)38bbb04
v11.5.2
Docs
- Add hpagent to proxy section (#1363)
a3e171c
- Mention header lowercasing in
request
migration guide (#1387)a748343
- Fixed deprecationWarning on https options (#1391)
9a309bd
Bug fixes
v11.5.1
Enhancements
- Upgrade
http2-wrapper
to1.0.0-beta.5.0
16e7f03
- Compatibility fix to ignore incorrect Node.js 12 typings
f7a1379
61d6f61
Bug fixes
Docs
- Mention HTTP/2 proxying in
readme.md
4ebd26a
- Update the comparison table
bd2d532
c833939
- Document the hierarchy of error classes (#1359)
559526e
- Fix example code for HTTPS proxy (#1360)
4083347
v11.5.0
Improvements
- Add
backoff
option to pagination (#1182)4be7446
- Upgrade dependencies (#1345)
b9a855d
476c026
8d697bc
- Upgrade to TypeScript 3.9 (#1267)
b51d836
Fixes
- Fix TypeScript types for Promise API (#1344)
676be6d
- Fix cache not working with HTTP2
ac5f67d
- Fix
response
event not being emitted on cache verify request (#1305)da4769e
- Work around a bug in Node.js <=12.18.2
f33e8bc
- Remove request error handler after response is downloaded
e1afe82
- Revert "Remove request error handler after response is downloaded"
aeb2e07
Docs
- Mention advanced usage of a
beforeRequest
hook779062a
- Mention to end the stream if there's no body
044767e
v11.4.0
- Fix hanging promise on timeout on HTTP error
934211f
- Use async iterators to get response body (#1256)
7dcd145
- Fix promise not returning Buffer on compressed response
5028c11
- Clarify options.encoding docs
04f3ea4
- Fix unhandled
The server aborted pending request
rejection728aef9
- Add missing
ECONNRESET
code to an abort errord325d35
- Fix
prefixUrl
not working when theurl
argument is empty8d3412a
- Improve the
searchParams
option4dbada9
- Fix non-enumerable options [such as body] not being used
8f775c7
v11.3.0
- Deep merge
https
options (#1304)c98f0d7
- Add options to customize parsing/stringifying JSON (#1298)
cb4da8d
- Add
dnsLookupIpVersion
option (#1264)7f643bb
v11.2.0
- Provide an overload for unknown
responseType
(#1276)b9ba18a
- Fix overriding some options in a
beforeRequest
hook (#1293)d8c00cf
- Fix hanging promise on aborted requests on Node v14.3.0 (#1296)
2ccc4c2
- Do not wait for
ready
event if the file descriptor is already opened (#1289)2c8fe19
- General improvements to HTTPS API (#1255)
697de37
v11.1.4
- Clarify docs for got.HTTPError (#1244)
3f125f1
- Upgrade
cacheable-lookup
to 5.0.39770e54
- Add a Runkit example (#1253)
48bbb36
- Mention
options.rejectUnauthorized
in the documentation9b04963
- Test
responseType
set toundefined
0e8582f
- Slightly improve RunKit example
6f84051
- Make
got.paginate()
an alias forgot.paginate.each()
5480b31
- Don't force query string normalization (#1246)
761b8e0
- Upgrade
decompress-response
to6.0.0
c2bc014
- Migrate from
lolex
to@sinonjs/fake-timers
(#1270)df333dd
- Make
calculateDelay
promisable (#1266)3745efc
v11.1.3
- Do not use deprecated
request.abort()
(#1242)ab338a7
- Remove the
host
header on redirect (#1241)8ff71d9
- Prevent URL pollution (#1243)
7dbb9ee
- Fix duplicated searchParams for pagination API (#1229)
91aa0ac
- Add a test for stringified
searchParams
in merge (#1208)7d7361c
- Fix reusing options when paginating
8862270
- Fix an invalid pagination test
47c1afe
5131dc2
v11.1.2
Bug fixes
- Disable
options.dnsCache
by default79507c2
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
v11.1.1
- Improve Node.js 14 compatibility
50ef99a
- Fix
got.mergeOptions()
regression157e02b
- Fix hanging promise when using cache
7b19e8f
- Make
options.responseType
optional when using a template9ed0a39
v11.1.0
- Add
pagination.stackAllItems
option (#1214)c1208d1
- Allow response body to be typed for pagination API (#1212)
c127f5b
- Fix some options not working with the pagination API
278c421
v11.0.3
Fixes
- Limit number of requests in pagination to prevent accidental overflows (#1181)
4344c3a
- Fix promise rejecting before retry
b927e2d
- Fix
options.searchParams
duplicates429db40
- Prevent calling
.abort()
on a destroyed request63c1b72
Docs
- Fix incorrect usage in the readme examples (#1203)
16ff82f
- Note that
cache
anddnsCache
can befalse
7c5290d
v11.0.2
- Fix
response.statusMessage
being null965bd03
- Update the
http2-wrapper
dependency to1.0.0-beta.4.4
4e8de8e
- Use
Merge
as it's stricter than the intersection operatord3b972e
- Prevent silent rejections in rare cases
8501c69
- Do not alter
options.body
835c70b
v11.0.1
Fixed two regressions:
Improved TypeScript types for errors inherited from RequestError
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.
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. Any suggestion is greatly appreciated!
{
- _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 callstream.setEncoding(encoding)
.
-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 toRequestError
for better readability and to comply with the documentation.
-const {GotError} = require('got');
+const {RequestError} = require('got');
- The
agent
option now accepts only an object withhttp
,https
andhttp2
properties. While thehttp
andhttps
properties accept nativehttp(s).Agent
instances, thehttp2
property must be an instance ofhttp2wrapper.Agent
or be undefined.
{
- 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 ofCacheableLookup
. It cannot be aMap
-like instance anymore. The underlyingcacheable-lookup
package has received many improvements, for example, it has receivedhosts
file support! Additionally, thecacheAdapter
option has been renamed tocache
. Note that it's no longer passed to Keyv, so you need to pass a Keyv instance it if you want to save the data for later.
{
- 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 ofRequestError
.RequestError
s provide much more useful information, for example, you can access the Got options (througherror.options
), which is very useful when debugging.
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 aurl
property. To modify the request URL you should use abeforeRequest
hook instead.
{
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 aClientRequest
instance. Instead, it gives a Got stream, which provides a set of useful properties.
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 |
- 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.
const got = require('got');
(async () => {
const response = await got('https://nghttp2.org/httpbin/anything', {http2: true});
console.log(response.socket.alpnProtocol);
//=> 'h2'
})();
- The
merge
function is slow (#1016) - Use
error.code
instead oferror.message
to compare errors (#981) - Pass error thrown in the
init
hook tobeforeError
hook (#929) - Errors have undefined body when using streams (#1138)
- Spaces should be normalized as
+
in query strings (#1113) - Modify response headers while using
got.stream(...)
(#1129) - Make
error.request
a Got stream (af0b147
).
Known bugs
- When some errors occur, the
timings
may indicate that the request was successful although it failed. - When some errors occur, the
downloadProgress
object may show incorrect data.
Bug fixes
- Requests to UNIX sockets are missing query strings (#1036)
-
beforeRequest
hooks aren't called on redirects (#994) - Errors are swallowed when using
stream.pipeline(got.stream(...), ...)
(#1026) - Cannot use the
cache
along with thebody
option (#1021) - Got doesn't throw on leading slashes (#1057)
- Got throws when passing already frozen options (#1050)
- Cannot type Got options properly due to missing types (#954)
-
got.mergeOptions(...)
doesn't mergeURLSearchParams
instances (#1011) - The
authorization
header is leaking (#1090) - Pagination should ignore the
resolveBodyOnly
option (#1140) - Cannot reuse user-provided options (#1118)
- Broken with Node.js ≥ 13.10.0 (#1107)
- Cache is not decompressed (#1158)
-
beforeRetry
hooks are missingoptions.context
(#1141) -
promise.json()
doesn't throwParseError
(#1069) - Not compatible with
[email protected]
(#1131) - Shortcuts give body from the failed request on token renewal (#1120)
- No effect when replacing the
cache
option in a Got instance (#1098) - Memory leak when using
cache
(#1128) - Got doesn't throw on aborted requests by the server (#1096)
All changes
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 these updates again.
- [ ] If you want to rebase/retry this PR, click this checkbox.
This PR has been generated by Mend Renovate. View repository job log here.