aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/fixtures
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-02-14 17:34:05 -0800
committerGravatar ncteisen <ncteisen@gmail.com>2018-02-14 17:34:05 -0800
commitbf323a985f0a6f2ab81fe07a790959aee743791d (patch)
tree0588ea5b13d4dc4535ac7c860a71ceddb673c924 /test/core/end2end/fixtures
parent6f374ea2fef54f0cf12af936bc9a30896830152f (diff)
Use grpc_channel_arg_get_string when appropriate
Diffstat (limited to 'test/core/end2end/fixtures')
-rw-r--r--test/core/end2end/fixtures/h2_http_proxy.cc5
-rw-r--r--test/core/end2end/fixtures/http_proxy_fixture.cc5
2 files changed, 6 insertions, 4 deletions
diff --git a/test/core/end2end/fixtures/h2_http_proxy.cc b/test/core/end2end/fixtures/h2_http_proxy.cc
index 017682f4c7..b990d7a763 100644
--- a/test/core/end2end/fixtures/h2_http_proxy.cc
+++ b/test/core/end2end/fixtures/h2_http_proxy.cc
@@ -72,11 +72,12 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f,
/* If testing for proxy auth, add credentials to proxy uri */
const grpc_arg* proxy_auth_arg =
grpc_channel_args_find(client_args, GRPC_ARG_HTTP_PROXY_AUTH_CREDS);
- if (proxy_auth_arg == nullptr || proxy_auth_arg->type != GRPC_ARG_STRING) {
+ const char* proxy_auth_str = grpc_channel_arg_get_string(proxy_auth_arg);
+ if (proxy_auth_str == nullptr) {
gpr_asprintf(&proxy_uri, "http://%s",
grpc_end2end_http_proxy_get_proxy_name(ffd->proxy));
} else {
- gpr_asprintf(&proxy_uri, "http://%s@%s", proxy_auth_arg->value.string,
+ gpr_asprintf(&proxy_uri, "http://%s@%s", proxy_auth_str,
grpc_end2end_http_proxy_get_proxy_name(ffd->proxy));
}
gpr_setenv("http_proxy", proxy_uri);
diff --git a/test/core/end2end/fixtures/http_proxy_fixture.cc b/test/core/end2end/fixtures/http_proxy_fixture.cc
index 289843e737..cf7855494f 100644
--- a/test/core/end2end/fixtures/http_proxy_fixture.cc
+++ b/test/core/end2end/fixtures/http_proxy_fixture.cc
@@ -413,12 +413,13 @@ static void on_read_request_done(void* arg, grpc_error* error) {
// If proxy auth is being used, check if the header is present and as expected
const grpc_arg* proxy_auth_arg = grpc_channel_args_find(
conn->proxy->channel_args, GRPC_ARG_HTTP_PROXY_AUTH_CREDS);
- if (proxy_auth_arg != nullptr && proxy_auth_arg->type == GRPC_ARG_STRING) {
+ const char* proxy_auth_str = grpc_channel_arg_get_string(proxy_auth_arg);
+ if (proxy_auth_str != nullptr) {
bool client_authenticated = false;
for (size_t i = 0; i < conn->http_request.hdr_count; i++) {
if (strcmp(conn->http_request.hdrs[i].key, "Proxy-Authorization") == 0) {
client_authenticated = proxy_auth_header_matches(
- conn->http_request.hdrs[i].value, proxy_auth_arg->value.string);
+ conn->http_request.hdrs[i].value, proxy_auth_str);
break;
}
}