@@ -25,6 +25,7 @@ import { logWrapper, splitStringBySize } from '../core/util/util';
2525import { SDK_VERSION } from '../core/version' ;
2626
2727import {
28+ APPLICATION_ID_PARAM ,
2829 APP_CHECK_TOKEN_PARAM ,
2930 FORGE_DOMAIN_RE ,
3031 FORGE_REF ,
@@ -99,7 +100,8 @@ export class WebSocketConnection implements Transport {
99100 repoInfo ,
100101 transportSessionId ,
101102 lastSessionId ,
102- appCheckToken
103+ appCheckToken ,
104+ applicationId
103105 ) ;
104106 this . nodeAdmin = repoInfo . nodeAdmin ;
105107 }
@@ -115,7 +117,8 @@ export class WebSocketConnection implements Transport {
115117 repoInfo : RepoInfo ,
116118 transportSessionId ?: string ,
117119 lastSessionId ?: string ,
118- appCheckToken ?: string
120+ appCheckToken ?: string ,
121+ applicationId ?: string
119122 ) : string {
120123 const urlParams : { [ k : string ] : string } = { } ;
121124 urlParams [ VERSION_PARAM ] = PROTOCOL_VERSION ;
@@ -137,6 +140,9 @@ export class WebSocketConnection implements Transport {
137140 if ( appCheckToken ) {
138141 urlParams [ APP_CHECK_TOKEN_PARAM ] = appCheckToken ;
139142 }
143+ if ( applicationId ) {
144+ urlParams [ APPLICATION_ID_PARAM ] = applicationId ;
145+ }
140146
141147 return repoInfoConnectionURL ( repoInfo , WEBSOCKET , urlParams ) ;
142148 }
@@ -156,6 +162,7 @@ export class WebSocketConnection implements Transport {
156162 PersistentStorage . set ( 'previous_websocket_failure' , true ) ;
157163
158164 try {
165+ let options : { [ k : string ] : object } ;
159166 if ( isNodeSdk ( ) ) {
160167 const device = this . nodeAdmin ? 'AdminNode' : 'Node' ;
161168 // UA Format: Firebase/<wire_protocol>/<sdk_version>/<platform>/<device>
@@ -188,17 +195,8 @@ export class WebSocketConnection implements Transport {
188195 if ( proxy ) {
189196 options [ 'proxy' ] = { origin : proxy } ;
190197 }
191-
192- this . mySock = new WebSocketImpl ( this . connURL , [ ] , options ) ;
193- } else {
194- const options : { [ k : string ] : object } = {
195- headers : {
196- 'X-Firebase-GMPID' : this . applicationId || '' ,
197- 'X-Firebase-AppCheck' : this . appCheckToken || ''
198- }
199- } ;
200- this . mySock = new WebSocketImpl ( this . connURL , [ ] , options ) ;
201198 }
199+ this . mySock = new WebSocketImpl ( this . connURL , [ ] , options ) ;
202200 } catch ( e ) {
203201 this . log_ ( 'Error instantiating WebSocket.' ) ;
204202 const error = e . message || e . data ;
0 commit comments