0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

fix fetching tarballs from npmjs registry

This commit is contained in:
Alex Kocharin 2013-10-02 22:48:32 +04:00
parent f38a897fa2
commit 16730bb7b4

View file

@ -36,7 +36,7 @@ Storage.prototype.request = function(options, cb) {
headers.accept = headers.accept || 'application/json';
headers['user-agent'] = headers['user-agent'] || this.userAgent;
var req = request({
url: this.config.url + options.uri,
url: options.uri_full || (this.config.url + options.uri),
method: options.method || 'GET',
headers: headers,
json: options.json || true,
@ -165,12 +165,11 @@ Storage.prototype.get_tarball = function(name, filename) {
}
Storage.prototype.get_url = function(url) {
url = URL.parse(url);
var stream = new mystreams.ReadTarballStream();
stream.abort = function() {};
var rstream = this.request({
uri: url.path,
uri_full: url,
encoding: null,
});