mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
fix fetching tarballs from npmjs registry
This commit is contained in:
parent
f38a897fa2
commit
16730bb7b4
1 changed files with 2 additions and 3 deletions
|
@ -36,7 +36,7 @@ Storage.prototype.request = function(options, cb) {
|
||||||
headers.accept = headers.accept || 'application/json';
|
headers.accept = headers.accept || 'application/json';
|
||||||
headers['user-agent'] = headers['user-agent'] || this.userAgent;
|
headers['user-agent'] = headers['user-agent'] || this.userAgent;
|
||||||
var req = request({
|
var req = request({
|
||||||
url: this.config.url + options.uri,
|
url: options.uri_full || (this.config.url + options.uri),
|
||||||
method: options.method || 'GET',
|
method: options.method || 'GET',
|
||||||
headers: headers,
|
headers: headers,
|
||||||
json: options.json || true,
|
json: options.json || true,
|
||||||
|
@ -165,12 +165,11 @@ Storage.prototype.get_tarball = function(name, filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Storage.prototype.get_url = function(url) {
|
Storage.prototype.get_url = function(url) {
|
||||||
url = URL.parse(url);
|
|
||||||
var stream = new mystreams.ReadTarballStream();
|
var stream = new mystreams.ReadTarballStream();
|
||||||
stream.abort = function() {};
|
stream.abort = function() {};
|
||||||
|
|
||||||
var rstream = this.request({
|
var rstream = this.request({
|
||||||
uri: url.path,
|
uri_full: url,
|
||||||
encoding: null,
|
encoding: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue