reachable-url 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -7
- package/index.js +8 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -65,13 +65,7 @@ const response = await reachableUrl('https://example.com/video.mp4', { cache })
|
|
|
65
65
|
response.body // => the whole entity, so it can be cached
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
`cache` needs [@kikobeats/cacheable-request](https://github.com/Kikobeats/cacheable-request):
|
|
69
|
-
|
|
70
|
-
```yaml
|
|
71
|
-
# pnpm-workspace.yaml
|
|
72
|
-
overrides:
|
|
73
|
-
got>cacheable-request: npm:@kikobeats/cacheable-request
|
|
74
|
-
```
|
|
68
|
+
`cache` needs [@kikobeats/cacheable-request](https://github.com/Kikobeats/cacheable-request): upstream [cacheable-request](https://github.com/jaredwray/cacheable/tree/main/packages/cacheable-request) never settles when the origin keeps the connection alive, and no timeout recovers from it. [@kikobeats/got](https://github.com/Kikobeats/got) depends on the fork since 11.8.9, so it works without any configuration. If something in your dependency tree still resolves the upstream package, passing `cache` throws instead of hanging.
|
|
75
69
|
|
|
76
70
|
#### returns
|
|
77
71
|
|
package/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const { URL } = require('url')
|
|
|
4
4
|
|
|
5
5
|
const RANGE_LENGTH = 1
|
|
6
6
|
|
|
7
|
-
const got = require('got').extend({
|
|
7
|
+
const got = require('@kikobeats/got').extend({
|
|
8
8
|
decompress: false,
|
|
9
9
|
responseType: 'buffer',
|
|
10
10
|
retry: 1,
|
|
@@ -30,15 +30,14 @@ const toResponse = response => ({
|
|
|
30
30
|
|
|
31
31
|
const CACHE_ERROR = `The \`cache\` option needs @kikobeats/cacheable-request.
|
|
32
32
|
|
|
33
|
-
got resolved the unpatched cacheable-request@7, which never settles
|
|
34
|
-
origin keeps the connection alive, and no timeout recovers from it.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
overrides:
|
|
38
|
-
got>cacheable-request: npm:@kikobeats/cacheable-request`
|
|
33
|
+
@kikobeats/got resolved the unpatched cacheable-request@7, which never settles
|
|
34
|
+
when the origin keeps the connection alive, and no timeout recovers from it.
|
|
35
|
+
Upgrade @kikobeats/got to 11.8.9 or later, which depends on the patched fork.`
|
|
39
36
|
|
|
40
37
|
const loadCacheableRequestManifest = () =>
|
|
41
|
-
require(require.resolve('cacheable-request/package.json', {
|
|
38
|
+
require(require.resolve('cacheable-request/package.json', {
|
|
39
|
+
paths: [require.resolve('@kikobeats/got')]
|
|
40
|
+
}))
|
|
42
41
|
|
|
43
42
|
// The override is an alias, which keeps the real package name, so the manifest says
|
|
44
43
|
// which one got resolved. Only a positive match rejects: the lookup can legitimately
|
|
@@ -175,3 +174,4 @@ module.exports = async (url, opts) => {
|
|
|
175
174
|
|
|
176
175
|
module.exports.isReachable = isReachable
|
|
177
176
|
module.exports.assertCacheSupport = assertCacheSupport
|
|
177
|
+
module.exports.loadCacheableRequestManifest = loadCacheableRequestManifest
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "reachable-url",
|
|
3
3
|
"description": "Resolve a URL as fast as possible and report whether the destination is reachable over HTTP.",
|
|
4
4
|
"homepage": "https://github.com/Kikobeats/reachable-url",
|
|
5
|
-
"version": "2.1.
|
|
5
|
+
"version": "2.1.4",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "josefrancisco.verdu@gmail.com",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"url"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"got": "~11.8.
|
|
33
|
+
"@kikobeats/got": "~11.8.9"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@commitlint/cli": "latest",
|