File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ const os = require('os');
7
7
const _ = require ( 'lodash' ) ;
8
8
const google = require ( 'googleapis' ) . google ;
9
9
10
+ const packageJson = require ( '../package.json' ) ;
11
+
10
12
const constants = {
11
13
providerName : 'google' ,
12
14
} ;
@@ -21,6 +23,16 @@ class GoogleProvider {
21
23
this . provider = this ; // only load plugin in a Google service context
22
24
this . serverless . setProvider ( constants . providerName , this ) ;
23
25
26
+ const serverlessVersion = this . serverless . version ;
27
+ const pluginVersion = packageJson . version ;
28
+ const googleApisVersion = packageJson . dependencies . googleapis ;
29
+
30
+ google . options ( {
31
+ headers : {
32
+ 'User-Agent' : `Serverless/${ serverlessVersion } Serverless-Google-Provider/${ pluginVersion } Googleapis/${ googleApisVersion } ` ,
33
+ } ,
34
+ } ) ;
35
+
24
36
this . sdk = {
25
37
deploymentmanager : google . deploymentmanager ( 'v2' ) ,
26
38
storage : google . storage ( 'v1' ) ,
You can’t perform that action at this time.
0 commit comments