diff options
author | ncteisen <ncteisen@gmail.com> | 2018-06-13 23:00:07 -0700 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2018-06-13 23:00:07 -0700 |
commit | f92460e539405bbca98af3547edd3150d0fcca40 (patch) | |
tree | dea35a54d1f6db8135df398c6e5a328ba3489609 /src/core/ext/filters/client_channel/http_proxy.cc | |
parent | 19ac7c0baf298be51c0dbfa7d5bcd1f45eec7c78 (diff) | |
parent | 9a2c0a8641d1837185a60436adf9419209f89fbe (diff) |
Merge branch 'master' of https://github.com/grpc/grpc into channelz
Diffstat (limited to 'src/core/ext/filters/client_channel/http_proxy.cc')
-rw-r--r-- | src/core/ext/filters/client_channel/http_proxy.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/ext/filters/client_channel/http_proxy.cc b/src/core/ext/filters/client_channel/http_proxy.cc index 29a6c0e367..e21de35a7d 100644 --- a/src/core/ext/filters/client_channel/http_proxy.cc +++ b/src/core/ext/filters/client_channel/http_proxy.cc @@ -83,11 +83,22 @@ done: return proxy_name; } +/** + * Checks the value of GRPC_ARG_ENABLE_HTTP_PROXY to determine if http_proxy + * should be used. + */ +bool http_proxy_enabled(const grpc_channel_args* args) { + return grpc_channel_args_get_bool(args, GRPC_ARG_ENABLE_HTTP_PROXY, true); +} + static bool proxy_mapper_map_name(grpc_proxy_mapper* mapper, const char* server_uri, const grpc_channel_args* args, char** name_to_resolve, grpc_channel_args** new_args) { + if (!http_proxy_enabled(args)) { + return false; + } char* user_cred = nullptr; *name_to_resolve = get_http_proxy_server(&user_cred); if (*name_to_resolve == nullptr) return false; |