Skip to content

Commit

Permalink
remove getter and setters (for sdk 9.0+); add individual timeout for …
Browse files Browse the repository at this point in the history
…every method
  • Loading branch information
Jórdan Luiz Bisato committed Jul 3, 2020
1 parent a78c0a2 commit 9f349db
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 @@ -293,6 +293,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 @@ -318,6 +319,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 @@ -568,4 +570,4 @@ var main = function () {
return reste;
};

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

0 comments on commit 9f349db

Please sign in to comment.