Skip to content

Remove "google-cloud-resource-prefix" header in favor of "database" url parameter in WebChannel requests. #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/firestore/src/platform_browser/webchannel_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ export class WebChannelConnection implements Connection {
}
}
headers['X-Goog-Api-Client'] = X_GOOG_API_CLIENT_VALUE;
// This header is used to improve routing and project isolation by the
// backend.
headers['google-cloud-resource-prefix'] =
`projects/${this.databaseId.projectId}/` +
`databases/${this.databaseId.database}`;
}

invokeRPC<Req, Resp>(
Expand Down Expand Up @@ -207,6 +202,13 @@ export class WebChannelConnection implements Connection {
// preflight round-trip. This is formally defined here:
// https://github.com/google/closure-library/blob/b0e1815b13fb92a46d7c9b3c30de5d6a396a3245/closure/goog/net/rpc/httpcors.js#L40
httpHeadersOverwriteParam: '$httpHeaders',
messageUrlParams: {
// This param is used to improve routing and project isolation by the
// backend and must be included in every request.
database: `projects/${this.databaseId.projectId}/databases/${
this.databaseId.database
}`
},
sendRawJson: true,
supportsCrossDomainXhr: true
};
Expand Down