deprecate "disableRedirect" in favor of "setFollowRedirect"

This commit is contained in:
Sefa Ilkimen
2019-04-15 18:09:34 +02:00
parent ccabbf2a29
commit c83940a8f6
10 changed files with 99 additions and 89 deletions
+9 -5
View File
@@ -12,8 +12,11 @@ module.exports = function init(exec, cookieHandler, urlUtil, helpers, globalConf
getCookieString: getCookieString,
getRequestTimeout: getRequestTimeout,
setRequestTimeout: setRequestTimeout,
getFollowRedirect: getFollowRedirect,
setFollowRedirect: setFollowRedirect,
// @DEPRECATED
disableRedirect: disableRedirect,
// for being backward compatible
// @DEPRECATED
setSSLCertMode: setServerTrustMode,
setServerTrustMode: setServerTrustMode,
setClientAuthMode: setClientAuthMode,
@@ -88,7 +91,7 @@ module.exports = function init(exec, cookieHandler, urlUtil, helpers, globalConf
}
function setRequestTimeout(timeout) {
globalConfigs.timeout = timeout;
globalConfigs.timeout = helpers.checkTimeoutValue(timeout);
}
function getFollowRedirect() {
@@ -96,14 +99,15 @@ module.exports = function init(exec, cookieHandler, urlUtil, helpers, globalConf
}
function setFollowRedirect(follow) {
globalConfigs.followRedirect = follow;
globalConfigs.followRedirect = helpers.checkFollowRedirectValue(follow);
}
// @TODO replace this one by "setFollowRedirect()"
// @DEPRECATED
function disableRedirect(disable, success, failure) {
helpers.handleMissingCallbacks(success, failure);
return exec(success, failure, 'CordovaHttpPlugin', 'disableRedirect', [!!disable]);
setFollowRedirect(!disable);
success();
}
function setServerTrustMode(mode, success, failure) {