aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-03-30 17:52:42 -0700
committerGravatar Muxi Yan <mxyan@google.com>2018-04-01 22:51:02 -0700
commitdfbf607ccb2a9871ee6cb2dfc8692dcbc02427b4 (patch)
tree9fd81a598fa4bffef0645e371abc8edac443fa4c /src/objective-c/GRPCClient/private
parent834aeca1807c77096c0b1a31dcd4cc74393b0a18 (diff)
Introduce channel arg to disable authority filter
Diffstat (limited to 'src/objective-c/GRPCClient/private')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.m11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index c282fbd194..152c3d3ed6 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -192,7 +192,7 @@ static NSMutableDictionary *kHostCache;
return YES;
}
-- (NSDictionary *)channelArgs {
+- (NSDictionary *)channelArgsUsingCronet:(BOOL)useCronet {
NSMutableDictionary *args = [NSMutableDictionary dictionary];
// TODO(jcanizales): Add OS and device information (see
@@ -226,14 +226,19 @@ static NSMutableDictionary *kHostCache;
args[@GRPC_ARG_MOBILE_LOG_CONFIG] = logConfig;
}
+ if (useCronet) {
+ args[@GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER] = [NSNumber numberWithInt:1];
+ }
+
return args;
}
- (GRPCChannel *)newChannel {
- NSDictionary *args = [self channelArgs];
+ BOOL useCronet = NO;
#ifdef GRPC_COMPILE_WITH_CRONET
- BOOL useCronet = [GRPCCall isUsingCronet];
+ useCronet = [GRPCCall isUsingCronet];
#endif
+ NSDictionary *args = [self channelArgsUsingCronet:useCronet];
if (_secure) {
GRPCChannel *channel;
@synchronized(self) {