Skip to content

Commit

Permalink
feat(registry): allow injection of request agents
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Apr 6, 2017
1 parent 154cb4b commit 805e5ae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/registry/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function manifest (spec, opts) {

const startTime = Date.now()
return fetch(uri, {
agent: opts.agent,
cache: opts.offline
? 'only-if-cached'
: opts.preferOffline
Expand Down
1 change: 1 addition & 0 deletions lib/registry/tarball.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function fromManifest (manifest, spec, opts) {
const auth = opts.auth && opts.auth[registryKey(registry)]
const startTime = Date.now()
fetch(uri, {
agent: opts.agent,
cache: opts.offline
? 'only-if-cached'
: opts.preferOffline
Expand Down
1 change: 1 addition & 0 deletions lib/util/opt-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var silentlog = require('./silentlog')
function PacoteOptions (opts) {
opts = opts || {}
this._isPacoteOptions = true
this.agent = opts.agent
this.annotate = opts.annotate
this.auth = opts.auth
this.scopeTargets = opts.scopeTargets || {}
Expand Down

0 comments on commit 805e5ae

Please sign in to comment.