Skip to content

Commit

Permalink
datastore: provide google-cloud-resource-prefix header
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Sep 2, 2016
1 parent bf9929e commit 163de54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/datastore/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,10 @@ function Datastore(options) {
service: 'datastore',
apiVersion: 'v1',
scopes: ['https://www.googleapis.com/auth/datastore'],
userAgent: PKG.name + '/' + PKG.version
userAgent: PKG.name + '/' + PKG.version,
grpcMetadata: {
'google-cloud-resource-prefix': 'projects/' + this.projectId
}
};

common.GrpcService.call(this, config, options);
Expand Down
3 changes: 3 additions & 0 deletions packages/datastore/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ describe('Datastore', function() {
'https://www.googleapis.com/auth/datastore'
]);
assert.strictEqual(calledWith.userAgent, PKG.name + '/' + PKG.version);
assert.deepEqual(calledWith.grpcMetadata, {
'google-cloud-resource-prefix': 'projects/' + datastore.projectId
});
});
});

Expand Down

0 comments on commit 163de54

Please sign in to comment.