summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/pacote/lib/fetchers/registry
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/pacote/lib/fetchers/registry')
-rw-r--r--deps/npm/node_modules/pacote/lib/fetchers/registry/check-warning-header.js13
-rw-r--r--deps/npm/node_modules/pacote/lib/fetchers/registry/manifest.js2
-rw-r--r--deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js5
3 files changed, 13 insertions, 7 deletions
diff --git a/deps/npm/node_modules/pacote/lib/fetchers/registry/check-warning-header.js b/deps/npm/node_modules/pacote/lib/fetchers/registry/check-warning-header.js
index bd4dbc5175..b17a233d43 100644
--- a/deps/npm/node_modules/pacote/lib/fetchers/registry/check-warning-header.js
+++ b/deps/npm/node_modules/pacote/lib/fetchers/registry/check-warning-header.js
@@ -21,11 +21,14 @@ function checkWarnings (res, registry, opts) {
}
})
BAD_HOSTS.set(registry, true)
- if (warnings['199'] && warnings['199'].message.match(/ENOTFOUND/)) {
- opts.log.warn('registry', `Using stale data from ${registry} because the host is inaccessible -- are you offline?`)
- } else if (warnings['199']) {
- opts.log.warn('registry', `Unexpected warning for ${registry}: ${warnings['199'].message}`)
- } else if (warnings['111']) {
+ if (warnings['199']) {
+ if (warnings['199'].message.match(/ENOTFOUND/)) {
+ opts.log.warn('registry', `Using stale data from ${registry} because the host is inaccessible -- are you offline?`)
+ } else {
+ opts.log.warn('registry', `Unexpected warning for ${registry}: ${warnings['199'].message}`)
+ }
+ }
+ if (warnings['111']) {
// 111 Revalidation failed -- we're using stale data
opts.log.warn(
'registry',
diff --git a/deps/npm/node_modules/pacote/lib/fetchers/registry/manifest.js b/deps/npm/node_modules/pacote/lib/fetchers/registry/manifest.js
index febebfbde5..be67c2e455 100644
--- a/deps/npm/node_modules/pacote/lib/fetchers/registry/manifest.js
+++ b/deps/npm/node_modules/pacote/lib/fetchers/registry/manifest.js
@@ -88,7 +88,7 @@ function fetchPackument (uri, spec, registry, opts) {
// Force integrity to null: we never check integrity hashes for manifests
integrity: null
})).then(res => res.json().then(packument => {
- packument._cached = res.headers.has('x-local-cache')
+ packument._cached = decodeURIComponent(res.headers.has('x-local-cache'))
packument._contentLength = +res.headers.get('content-length')
// NOTE - we need to call pickMem again because proxy
// objects get reused!
diff --git a/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js b/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js
index 8ad2b6860b..2c63872e7f 100644
--- a/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js
+++ b/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js
@@ -51,7 +51,10 @@ function fromManifest (manifest, spec, opts) {
],
spec
}, opts)).then(res => {
- stream.emit('integrity', res.headers.get('x-local-cache-hash'))
+ const hash = res.headers.get('x-local-cache-hash')
+ if (hash) {
+ stream.emit('integrity', decodeURIComponent(hash))
+ }
res.body.on('error', err => stream.emit('error', err))
res.body.pipe(stream)
}).catch(err => stream.emit('error', err))