aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/tests/CronetUnitTests
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/tests/CronetUnitTests
parent834aeca1807c77096c0b1a31dcd4cc74393b0a18 (diff)
Introduce channel arg to disable authority filter
Diffstat (limited to 'src/objective-c/tests/CronetUnitTests')
-rw-r--r--src/objective-c/tests/CronetUnitTests/CronetUnitTests.m14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m b/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
index 28414b8e39..3da7d533b4 100644
--- a/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
+++ b/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
@@ -126,6 +126,14 @@ unsigned int parse_h2_length(const char *field) {
((unsigned int)(unsigned char)(field[2]));
}
+grpc_channel_args *add_disable_client_authority_filter_args(grpc_channel_args *args) {
+ grpc_arg arg;
+ arg.key = const_cast<char*>(GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER);
+ arg.type = GRPC_ARG_INTEGER;
+ arg.value.integer = 1;
+ return grpc_channel_args_copy_and_add(args, &arg, 1);
+}
+
- (void)testInternalError {
grpc_call *c;
grpc_slice request_payload_slice =
@@ -147,8 +155,10 @@ unsigned int parse_h2_length(const char *field) {
gpr_join_host_port(&addr, "127.0.0.1", port);
grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
stream_engine *cronetEngine = [Cronet getGlobalEngine];
+ grpc_channel_args *client_args = add_disable_client_authority_filter_args(NULL);
grpc_channel *client =
- grpc_cronet_secure_channel_create(cronetEngine, addr, NULL, NULL);
+ grpc_cronet_secure_channel_create(cronetEngine, addr, client_args, NULL);
+ grpc_channel_args_destroy(client_args);
cq_verifier *cqv = cq_verifier_create(cq);
grpc_op ops[6];
@@ -262,6 +272,8 @@ unsigned int parse_h2_length(const char *field) {
arg.type = GRPC_ARG_INTEGER;
arg.value.integer = useCoalescing ? 1 : 0;
grpc_channel_args *args = grpc_channel_args_copy_and_add(NULL, &arg, 1);
+ args = add_disable_client_authority_filter_args(args);
+
grpc_call *c;
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");