Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/jasonkneen/RESTe
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkneen committed Sep 7, 2021
2 parents a0092c0 + 08c21c6 commit cb35876
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.timeout = 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 cb35876

Please sign in to comment.