Skip to content

Commit d92eb14

Browse files
authored
Change cloud resource prefix (#9056)
* Change cloud resource prefix * Sending both headers.
1 parent bcc81c8 commit d92eb14

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Firestore/core/src/remote/grpc_connection.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const char* const kAppCheckHeader = "x-firebase-appcheck";
6161
const char* const kAuthorizationHeader = "authorization";
6262
const char* const kXGoogApiClientHeader = "x-goog-api-client";
6363
const char* const kGoogleCloudResourcePrefix = "google-cloud-resource-prefix";
64+
const char* const kXGoogRequestParams = "x-goog-request-params";
6465

6566
std::string MakeString(absl::string_view view) {
6667
return view.data() ? std::string{view.data(), view.size()} : std::string{};
@@ -272,9 +273,15 @@ std::unique_ptr<grpc::ClientContext> GrpcConnection::CreateContext(
272273
// This header is used to improve routing and project isolation by the
273274
// backend.
274275
const DatabaseId& db_id = database_info_->database_id();
276+
// TODO(b/199767712): We are keeping this until Emulators can be released with
277+
// this cl/428820046. Currently blocked because Emulators are now built with
278+
// Java 11 from Google3.
275279
context->AddMetadata(kGoogleCloudResourcePrefix,
276280
StringFormat("projects/%s/databases/%s",
277281
db_id.project_id(), db_id.database_id()));
282+
context->AddMetadata(kXGoogRequestParams,
283+
StringFormat("projects/%s/databases/%s",
284+
db_id.project_id(), db_id.database_id()));
278285
return context;
279286
}
280287

0 commit comments

Comments
 (0)