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';
3939RPC_NAME_URL_MAPPING [ 'RunQuery' ] = 'runQuery' ;
4040
4141const RPC_URL_VERSION = 'v1' ;
42- const X_GOOG_API_CLIENT_VALUE = 'gl-js/ fire/' + SDK_VERSION ;
4342
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+ }
4448/**
4549 * Base class for all Rest-based connections to the backend (WebChannel and
4650 * HTTP).
@@ -118,7 +122,7 @@ export abstract class RestConnection implements Connection {
118122 headers : StringMap ,
119123 token : Token | null
120124 ) : void {
121- headers [ 'X-Goog-Api-Client' ] = X_GOOG_API_CLIENT_VALUE ;
125+ headers [ 'X-Goog-Api-Client' ] = getGoogApiClientValue ( ) ;
122126
123127 // Content-Type: text/plain will avoid preflight requests which might
124128 // mess with CORS and redirects by proxies. If we add custom headers
You can’t perform that action at this time.
0 commit comments