summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/pacote/lib/fetchers/registry/fetch.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/pacote/lib/fetchers/registry/fetch.js')
-rw-r--r--deps/npm/node_modules/pacote/lib/fetchers/registry/fetch.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/deps/npm/node_modules/pacote/lib/fetchers/registry/fetch.js b/deps/npm/node_modules/pacote/lib/fetchers/registry/fetch.js
index 46a926a1a1..1c6c8e8d6e 100644
--- a/deps/npm/node_modules/pacote/lib/fetchers/registry/fetch.js
+++ b/deps/npm/node_modules/pacote/lib/fetchers/registry/fetch.js
@@ -16,14 +16,19 @@ function regFetch (uri, registry, opts) {
algorithms: opts.algorithms,
cache: getCacheMode(opts),
cacheManager: opts.cache,
+ ca: opts.ca,
+ cert: opts.cert,
headers: getHeaders(uri, registry, opts),
integrity: opts.integrity,
+ key: opts.key,
+ localAddress: opts.localAddress,
memoize: opts.memoize,
noProxy: opts.noProxy,
Promise: BB,
proxy: opts.proxy,
referer: opts.refer,
retry: opts.retry,
+ strictSSL: !!opts.strictSSL,
timeout: opts.timeout,
uid: opts.uid,
gid: opts.gid
@@ -74,13 +79,15 @@ function getHeaders (uri, registry, opts) {
const headers = Object.assign({
'npm-in-ci': opts.isFromCI,
'npm-scope': opts.projectScope,
+ 'npm-session': opts.npmSession,
'user-agent': opts.userAgent,
'referer': opts.refer
}, opts.headers)
- const auth = (
+ // check for auth settings specific to this registry
+ let auth = (
opts.auth &&
opts.auth[registryKey(registry)]
- )
+ ) || opts.auth
// If a tarball is hosted on a different place than the manifest, only send
// credentials on `alwaysAuth`
const shouldAuth = auth && (
@@ -94,6 +101,8 @@ function getHeaders (uri, registry, opts) {
`${auth.username}:${auth.password}`, 'utf8'
).toString('base64')
headers.authorization = `Basic ${encoded}`
+ } else if (shouldAuth && auth._auth) {
+ headers.authorization = `Basic ${auth._auth}`
}
return headers
}