Skip to content

Commit

Permalink
all modules: ensure all User-Agents are set (#1568)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus authored and callmehiphop committed Sep 9, 2016
1 parent 25bb2ed commit 40618a9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"vision"
],
"dependencies": {
"@google-cloud/common": "^0.3.0",
"@google-cloud/common": "^0.5.0",
"arguejs": "^0.2.3",
"arrify": "^1.0.0",
"async": "^1.4.2",
Expand Down
4 changes: 1 addition & 3 deletions packages/google-cloud-vision/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ var request = require('request');
var rgbHex = require('rgb-hex');
var util = require('util');

var PKG = require('../package.json');

var VERY_UNLIKELY = 0;
var UNLIKELY = 1;
var POSSIBLE = 2;
Expand Down Expand Up @@ -72,7 +70,7 @@ function Vision(options) {
scopes: [
'https://www.googleapis.com/auth/cloud-platform'
],
userAgent: PKG.name + '/' + PKG.version
packageJson: require('../package.json')
};

common.Service.call(this, config, options);
Expand Down
4 changes: 1 addition & 3 deletions packages/google-cloud-vision/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ var Service = require('@google-cloud/common').Service;
var tmp = require('tmp');
var util = require('@google-cloud/common').util;

var PKG = require('../package.json');

var fakeUtil = extend({}, util);

function FakeService() {
Expand Down Expand Up @@ -101,7 +99,7 @@ describe('Vision', function() {
assert.deepEqual(calledWith.scopes, [
'https://www.googleapis.com/auth/cloud-platform'
]);
assert.strictEqual(calledWith.userAgent, PKG.name + '/' + PKG.version);
assert.deepEqual(calledWith.packageJson, require('../package.json'));
});
});

Expand Down

0 comments on commit 40618a9

Please sign in to comment.