Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

heroku-client

Package Overview
Dependencies
Maintainers
3
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heroku-client - npm Package Compare versions

Comparing version 2.2.2 to 2.3.0

lib/url.js

29

lib/request.js
'use strict';
var http = require('http');
var https = require('https');

@@ -7,2 +8,3 @@ var tunnel = require('tunnel-agent');

var q = require('q');
var URL = require('./url');
var pjson = require('../package.json');

@@ -24,3 +26,6 @@

}
this.host = options.host || 'api.heroku.com';
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;

@@ -35,3 +40,9 @@ this.callback = callback;

if (process.env.HEROKU_HTTP_PROXY_HOST) {
this.agent = tunnel.httpsOverHttp({
var tunnelFunc;
if (this.secure) {
tunnelFunc = tunnel.httpsOverHttp;
} else {
tunnelFunc = tunnel.httpOverHttp;
}
this.agent = tunnelFunc({
proxy: {

@@ -43,3 +54,7 @@ host: process.env.HEROKU_HTTP_PROXY_HOST,

} else {
this.agent = new https.Agent({ maxSockets: Number(process.env.HEROKU_CLIENT_MAX_SOCKETS) || 5000 });
if (this.secure) {
this.agent = new https.Agent({ maxSockets: Number(process.env.HEROKU_CLIENT_MAX_SOCKETS) || 5000 });
} else {
this.agent = new http.Agent({ maxSockets: Number(process.env.HEROKU_CLIENT_MAX_SOCKETS) || 5000 });
}
}

@@ -97,3 +112,3 @@ }

host: this.host,
port: 443,
port: this.port,
path: this.options.path,

@@ -110,3 +125,7 @@ auth: this.options.auth || ':' + this.options.token,

req = https.request(requestOptions, this.handleResponse.bind(this));
if (this.secure) {
req = https.request(requestOptions, this.handleResponse.bind(this));
} else {
req = http.request(requestOptions, this.handleResponse.bind(this));
}

@@ -113,0 +132,0 @@ this.logRequest(req);

2

package.json
{
"name": "heroku-client",
"description": "A wrapper for the Heroku v3 API",
"version": "2.2.2",
"version": "2.3.0",
"author": "Jonathan Clem",

@@ -6,0 +6,0 @@ "bugs": {

@@ -140,3 +140,4 @@ 'use strict';

makeRequest('/apps', { host: 'api.example.com' }, function() {
expect(https.request.mostRecentCall.args[0].host).toEqual('api.example.com');
expect(http.request.mostRecentCall.args[0].host).toEqual('api.example.com');
expect(http.request.mostRecentCall.args[0].port).toEqual(80);
done();

@@ -143,0 +144,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc