acceptAllHosts can now be called on both platform.

This commit is contained in:
Denis Babineau
2015-07-28 11:15:32 -03:00
parent 43b04a94e2
commit cabb0db9de
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -9,6 +9,7 @@
- (void)setHeader:(CDVInvokedUrlCommand*)command;
- (void)enableSSLPinning:(CDVInvokedUrlCommand*)command;
- (void)acceptAllCerts:(CDVInvokedUrlCommand*)command;
- (void)acceptAllHosts:(CDVInvokedUrlCommand*)command;
- (void)post:(CDVInvokedUrlCommand*)command;
- (void)get:(CDVInvokedUrlCommand*)command;
- (void)uploadFile:(CDVInvokedUrlCommand*)command;
+8
View File
@@ -71,6 +71,14 @@
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
- (void)acceptAllHosts:(CDVInvokedUrlCommand*)command {
CDVPluginResult* pluginResult = nil;
bool allow = [[command.arguments objectAtIndex:0] boolValue];
[HttpManager sharedClient].securityPolicy.validatesDomainName = !allow;
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
- (void)post:(CDVInvokedUrlCommand*)command {
HttpManager *manager = [HttpManager sharedClient];
NSString *url = [command.arguments objectAtIndex:0];