Skip to content

Commit

Permalink
Merge pull request #76 from jordanbisato/master
Browse files Browse the repository at this point in the history
Remove getters and setters; Add individual timeout for methods
  • Loading branch information
jasonkneen authored Mar 15, 2021
2 parents 47a9cbf + 9f349db commit 08c21c6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions reste.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ var main = function () {

var formEncode = false;

http.setTimeout(config.timeout || 10000);
http.timeout = args.timeout || config.timeout || 10000;

if (_.has(config, "validatesSecureCertificate")) {
http.setValidatesSecureCertificate(config.validatesSecureCertificate);
http.validatesSecureCertificate = config.validatesSecureCertificate
}

if (args.url.indexOf("http") >= 0) {
Expand Down Expand Up @@ -115,7 +115,7 @@ var main = function () {
}

if (_.has(config, "securityManager")) {
http.setSecurityManager(config.securityManager);
http.securityManager = config.securityManager;
}

http.onload = function (e) {
Expand Down Expand Up @@ -295,6 +295,7 @@ var main = function () {
return makeHttpRequest({
url: url,
method: method,
timeout: args.timeout || config.timeout || 10000,
params: body,
headers: args.requestHeaders || args.headers,
beforePost: args.beforePost,
Expand All @@ -321,6 +322,7 @@ var main = function () {
return makeHttpRequest({
url: url,
method: method,
timeout: args.timeout || config.timeout || 10000,
params: body,
headers: args.requestHeaders || args.headers,
beforePost: args.beforePost,
Expand Down Expand Up @@ -575,4 +577,4 @@ var main = function () {
return reste;
};

module.exports = main;
module.exports = main;

0 comments on commit 08c21c6

Please sign in to comment.