File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,9 @@ function createMetadata(
56
56
}
57
57
}
58
58
}
59
- metadata . set ( 'X-Firebase-GMPID' , appId ) ;
59
+ if ( appId ) {
60
+ metadata . set ( 'X-Firebase-GMPID' , appId ) ;
61
+ }
60
62
metadata . set ( 'X-Goog-Api-Client' , X_GOOG_API_CLIENT_VALUE ) ;
61
63
// This header is used to improve routing and project isolation by the
62
64
// backend.
Original file line number Diff line number Diff line change @@ -119,14 +119,16 @@ export abstract class RestConnection implements Connection {
119
119
token : Token | null
120
120
) : void {
121
121
headers [ 'X-Goog-Api-Client' ] = X_GOOG_API_CLIENT_VALUE ;
122
- headers [ 'X-Firebase-GMPID' ] = this . databaseInfo . appId ;
123
122
124
123
// Content-Type: text/plain will avoid preflight requests which might
125
124
// mess with CORS and redirects by proxies. If we add custom headers
126
125
// we will need to change this code to potentially use the $httpOverwrite
127
126
// parameter supported by ESF to avoid triggering preflight requests.
128
127
headers [ 'Content-Type' ] = 'text/plain' ;
129
128
129
+ if ( this . databaseInfo . appId ) {
130
+ headers [ 'X-Firebase-GMPID' ] = this . databaseInfo . appId ;
131
+ }
130
132
if ( token ) {
131
133
for ( const header in token . authHeaders ) {
132
134
if ( token . authHeaders . hasOwnProperty ( header ) ) {
You can’t perform that action at this time.
0 commit comments