Skip to content

Commit

Permalink
set agent:false for requests
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgm committed Apr 9, 2013
1 parent 96bb71e commit a17d0ae
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion lib/heartbeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ var check = exports.check = function(url, cb) {
var req = require(url.scheme).get({
host: url.host,
port: url.port,
path: exports.path
path: exports.path,
agent: false
}, function (res) {
clearTimeout(timeoutHandle);
if (res.statusCode === 200) cb(null, true);
Expand Down
1 change: 1 addition & 0 deletions lib/primary.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ var fetchWellKnown = function (currentDomain, principalDomain, clientCB) {
host: httpProxy.host,
port: httpProxy.port,
path: 'https://' + currentDomain + WELL_KNOWN_URL + "?domain=" + principalDomain,
agent: false,
headers: {
host: currentDomain
}
Expand Down
3 changes: 2 additions & 1 deletion lib/wsapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ exports.requestToDBWriter = function(opts, cb) {
port: exports.forwardWritesTo.port,
path: opts.path,
method: opts.method || "GET",
headers: opts.headers
headers: opts.headers,
agent: false
}, function(res) {
var respBody = "";
res.on('data', function(chunk) {
Expand Down
1 change: 1 addition & 0 deletions lib/wsapi/authenticate_user.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ function updateHash(req, res, uid, hash) {
port: u.port,
path: '/wsapi/update_password',
method: "POST",
agent: false,
headers: {
'Cookie': res._headers['set-cookie'],
'Content-Type': 'application/x-www-form-urlencoded',
Expand Down
16 changes: 9 additions & 7 deletions lib/wsapi/interaction_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ var store = function (kpi_json, cb) {
port: http_proxy.port,
path: db_url,
method: 'POST',
agent: false,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': post_data.length
Expand All @@ -62,13 +63,14 @@ var store = function (kpi_json, cb) {
kpi_req = http.request(options);
} else {
options = {
hostname: db_url.host,
path: db_url.path,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': post_data.length
}
hostname: db_url.host,
path: db_url.path,
method: 'POST',
agent: false,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': post_data.length
}
};

if (db_url.port) {
Expand Down

0 comments on commit a17d0ae

Please sign in to comment.