File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/firestore/src/remote Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,12 @@ RPC_NAME_URL_MAPPING['Commit'] = 'commit';
39
39
RPC_NAME_URL_MAPPING [ 'RunQuery' ] = 'runQuery' ;
40
40
41
41
const RPC_URL_VERSION = 'v1' ;
42
- const X_GOOG_API_CLIENT_VALUE = 'gl-js/ fire/' + SDK_VERSION ;
43
42
43
+ // SDK_VERSION is updated to different value at runtime depending on the entry point,
44
+ // so we need to get its value when we need it in a function.
45
+ function getGoogApiClientValue ( ) {
46
+ return 'gl-js/ fire/' + SDK_VERSION ;
47
+ }
44
48
/**
45
49
* Base class for all Rest-based connections to the backend (WebChannel and
46
50
* HTTP).
@@ -118,7 +122,7 @@ export abstract class RestConnection implements Connection {
118
122
headers : StringMap ,
119
123
token : Token | null
120
124
) : void {
121
- headers [ 'X-Goog-Api-Client' ] = X_GOOG_API_CLIENT_VALUE ;
125
+ headers [ 'X-Goog-Api-Client' ] = getGoogApiClientValue ( ) ;
122
126
123
127
// Content-Type: text/plain will avoid preflight requests which might
124
128
// mess with CORS and redirects by proxies. If we add custom headers
You can’t perform that action at this time.
0 commit comments