Skip to content

Commit 4a437f9

Browse files
author
Sefa Ilkimen
committed
fix docu for "disableRedirect"
1 parent 2d15b86 commit 4a437f9

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@ cordova.plugin.http.setHeader('www.example.com', 'Header', 'Value');
9393
cordova.plugin.http.setHeader('www.example.com:8080', 'Header', 'Value');
9494
```
9595

96-
### disableRedirect
97-
If set to `true`, it won't follow redirects automatically. This is a global setting.
98-
99-
```js
100-
cordova.plugin.http.disableRedirect(true);
101-
```
102-
10396
### setDataSerializer<a name="setDataSerializer"></a>
10497
Set the data serializer which will be used for all future PATCH, POST and PUT requests. Takes a string representing the name of the serializer.
10598

@@ -173,6 +166,17 @@ cordova.plugin.http.acceptAllCerts(true, function() {
173166
});
174167
```
175168

169+
### disableRedirect
170+
If set to `true`, it won't follow redirects automatically. This defaults to false.
171+
172+
```js
173+
cordova.plugin.http.disableRedirect(true, function() {
174+
console.log('success!');
175+
}, function() {
176+
console.log('error :(');
177+
});
178+
```
179+
176180
### validateDomainName
177181
This function was removed in v1.6.2. Domain name validation is disabled automatically when you enable "acceptAllCerts".
178182

www/advanced-http.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ var publicInterface = {
6868
globalConfigs.timeout = timeout;
6969
},
7070
enableSSLPinning: function (enable, success, failure) {
71-
return exec(success, failure, 'CordovaHttpPlugin', 'enableSSLPinning', [enable]);
71+
return exec(success, failure, 'CordovaHttpPlugin', 'enableSSLPinning', [ enable ]);
7272
},
7373
acceptAllCerts: function (allow, success, failure) {
74-
return exec(success, failure, 'CordovaHttpPlugin', 'acceptAllCerts', [allow]);
74+
return exec(success, failure, 'CordovaHttpPlugin', 'acceptAllCerts', [ allow ]);
7575
},
7676
disableRedirect: function (disable, success, failure) {
77-
return exec(success, failure, 'CordovaHttpPlugin', 'disableRedirect', [disable]);
77+
return exec(success, failure, 'CordovaHttpPlugin', 'disableRedirect', [ disable ]);
7878
},
7979
sendRequest: function (url, options, success, failure) {
8080
helpers.handleMissingCallbacks(success, failure);

0 commit comments

Comments
 (0)