heroku-client
Advanced tools
Comparing version
@@ -26,14 +26,15 @@ 'use strict'; | ||
} | ||
var url = URL(options.host || 'https://api.heroku.com'); | ||
this.host = url.host; | ||
this.port = url.port; | ||
this.secure = url.secure; | ||
this.partial = options.partial; | ||
this.callback = callback; | ||
this.deferred = q.defer(); | ||
this.userAgent = options.userAgent || 'node-heroku-client/' + pjson.version; | ||
this.parseJSON = options.hasOwnProperty('parseJSON') ? options.parseJSON : true; | ||
this.nextRange = 'id ]..; max=1000'; | ||
this.logger = options.logger; | ||
this.cache = options.cache; | ||
var url = URL(options.host || 'https://api.heroku.com'); | ||
this.host = url.host; | ||
this.port = url.port; | ||
this.secure = url.secure; | ||
this.partial = options.partial; | ||
this.callback = callback; | ||
this.deferred = q.defer(); | ||
this.userAgent = options.userAgent || 'node-heroku-client/' + pjson.version; | ||
this.parseJSON = options.hasOwnProperty('parseJSON') ? options.parseJSON : true; | ||
this.nextRange = 'id ]..; max=1000'; | ||
this.logger = options.logger; | ||
this.cache = options.cache; | ||
this.middleware = options.middleware || function (_, cb) {cb();}; | ||
if (process.env.HEROKU_HTTP_PROXY_HOST) { | ||
@@ -144,22 +145,24 @@ var tunnelFunc; | ||
var self = this; | ||
this.logResponse(res); | ||
if (res.statusCode === 304 && this.cachedResponse) { | ||
if (this.cachedResponse.nextRange) { | ||
this.nextRequest(this.cachedResponse.nextRange, this.cachedResponse.body); | ||
} else { | ||
this.updateAggregate(this.cachedResponse.body); | ||
this.deferred.resolve(this.aggregate); | ||
this.callback(null, this.aggregate); | ||
this.middleware(res, function () { | ||
self.logResponse(res); | ||
if (res.statusCode === 304 && self.cachedResponse) { | ||
if (self.cachedResponse.nextRange) { | ||
self.nextRequest(self.cachedResponse.nextRange, self.cachedResponse.body); | ||
} else { | ||
self.updateAggregate(self.cachedResponse.body); | ||
self.deferred.resolve(self.aggregate); | ||
self.callback(null, self.aggregate); | ||
} | ||
return; | ||
} | ||
return; | ||
} | ||
concat(res, function (data) { | ||
if (self.debug) { | ||
console.error('<-- ' + data); | ||
} | ||
if (res.statusCode.toString().match(/^2\d{2}$/)) { | ||
self.handleSuccess(res, data); | ||
} else { | ||
self.handleFailure(res, data); | ||
} | ||
concat(res, function (data) { | ||
if (self.debug) { | ||
console.error('<-- ' + data); | ||
} | ||
if (res.statusCode.toString().match(/^2\d{2}$/)) { | ||
self.handleSuccess(res, data); | ||
} else { | ||
self.handleFailure(res, data); | ||
} | ||
}); | ||
}); | ||
@@ -166,0 +169,0 @@ }; |
{ | ||
"name": "heroku-client", | ||
"description": "A wrapper for the Heroku v3 API", | ||
"version": "2.3.2", | ||
"version": "2.4.0", | ||
"author": "Jonathan Clem", | ||
@@ -6,0 +6,0 @@ "bugs": { |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
314831
0.05%9939
0.03%