File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ google::cloud::storage::Client DefaultGrpcClient(Options opts) {
2626 using ::google::cloud::internal::GetEnv;
2727 auto const config = GetEnv (" GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG" )
2828 .value_or (opts.get <GrpcPluginOption>());
29- if (config == " none" || config. empty () ) {
29+ if (config == " none" ) {
3030 return google::cloud::storage::Client (std::move (opts));
3131 }
32- if (config == " metadata" ) {
32+ if (config == " metadata" || config. empty () ) {
3333 opts = google::cloud::storage_internal::DefaultOptionsGrpc (std::move (opts));
3434 return storage::internal::ClientImplDetails::CreateClient (
3535 storage_internal::GrpcClient::Create (opts));
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ TEST(GrpcPluginTest, EnvironmentOverrides) {
7676 ASSERT_THAT (grpc, IsNull ());
7777}
7878
79- TEST (GrpcPluginTest, UnsetConfigCreatesCurl ) {
79+ TEST (GrpcPluginTest, UnsetConfigCreatesMetadata ) {
8080 // Explicitly disable logging, which may be enabled by our CI builds.
8181 auto logging =
8282 ScopedEnvironment (" CLOUD_STORAGE_ENABLE_TRACING" , absl::nullopt );
@@ -86,8 +86,8 @@ TEST(GrpcPluginTest, UnsetConfigCreatesCurl) {
8686 auto const * const retry =
8787 dynamic_cast <RetryClient*>(ClientImplDetails::GetRawClient (client).get ());
8888 ASSERT_THAT (retry, NotNull ());
89- auto const * const rest = dynamic_cast <RestClient *>(retry->client ().get ());
90- ASSERT_THAT (rest , NotNull ());
89+ auto const * const grpc = dynamic_cast <GrpcClient *>(retry->client ().get ());
90+ ASSERT_THAT (grpc , NotNull ());
9191}
9292
9393TEST (GrpcPluginTest, NoneConfigCreatesCurl) {
Original file line number Diff line number Diff line change @@ -35,9 +35,9 @@ cc_proto_library(
3535)
3636
3737VARIATIONS = {
38- "default" : {},
38+ "default" : {"GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG" : "none" },
3939 "grpc-media" : {"GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG" : "media" },
40- "grpc-metadata" : {"GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG" : "metadata " },
40+ "grpc-metadata" : {"GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG" : "" },
4141 "legacy-http" : {"GOOGLE_CLOUD_CPP_STORAGE_USE_LEGACY_HTTP" : "yes" },
4242}
4343
You can’t perform that action at this time.
0 commit comments